Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2772353002: Revert of Add StyleDifference::needsVisualRectUpdate (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 diff.setNeedsFullLayout(); 554 diff.setNeedsFullLayout();
555 else 555 else
556 diff.setNeedsPositionedMovementLayout(); 556 diff.setNeedsPositionedMovementLayout();
557 } 557 }
558 558
559 if (diffNeedsPaintInvalidationSubtree(other)) 559 if (diffNeedsPaintInvalidationSubtree(other))
560 diff.setNeedsPaintInvalidationSubtree(); 560 diff.setNeedsPaintInvalidationSubtree();
561 else if (diffNeedsPaintInvalidationObject(other)) 561 else if (diffNeedsPaintInvalidationObject(other))
562 diff.setNeedsPaintInvalidationObject(); 562 diff.setNeedsPaintInvalidationObject();
563 563
564 if (diffNeedsVisualRectUpdate(other)) 564 updatePropertySpecificDifferences(other, diff);
565 diff.setNeedsVisualRectUpdate();
566 565
567 // This needs to be at last, because it may depend on conditions in diff 566 // The following condition needs to be at last, because it may depend on
568 // computed above. 567 // conditions in diff computed above.
569 updatePropertySpecificDifferences(other, diff); 568 if (scrollAnchorDisablingPropertyChanged(other, diff))
569 diff.setScrollAnchorDisablingPropertyChanged();
570 570
571 // Cursors are not checked, since they will be set appropriately in response 571 // Cursors are not checked, since they will be set appropriately in response
572 // to mouse events, so they don't need to cause any paint invalidation or 572 // to mouse events, so they don't need to cause any paint invalidation or
573 // layout. 573 // layout.
574 574
575 // Animations don't need to be checked either. We always set the new style on 575 // Animations don't need to be checked either. We always set the new style on
576 // the layoutObject, so we will get a chance to fire off the resulting 576 // the layoutObject, so we will get a chance to fire off the resulting
577 // transition properly. 577 // transition properly.
578 578
579 return diff; 579 return diff;
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 for (const AtomicString& property : 997 for (const AtomicString& property :
998 *value->customInvalidationProperties()) { 998 *value->customInvalidationProperties()) {
999 if (!dataEquivalent(getVariable(property), other.getVariable(property))) 999 if (!dataEquivalent(getVariable(property), other.getVariable(property)))
1000 return true; 1000 return true;
1001 } 1001 }
1002 } 1002 }
1003 1003
1004 return false; 1004 return false;
1005 } 1005 }
1006 1006
1007 // This doesn't include conditions needing layout or overflow recomputation
1008 // which implies visual rect update.
1009 bool ComputedStyle::diffNeedsVisualRectUpdate(
1010 const ComputedStyle& other) const {
1011 // Visual rect is empty if visibility is hidden.
1012 if (visibility() != other.visibility())
1013 return true;
1014
1015 // Need to update visual rect of the resizer.
1016 if (resize() != other.resize())
1017 return true;
1018
1019 return false;
1020 }
1021
1022 void ComputedStyle::updatePropertySpecificDifferences( 1007 void ComputedStyle::updatePropertySpecificDifferences(
1023 const ComputedStyle& other, 1008 const ComputedStyle& other,
1024 StyleDifference& diff) const { 1009 StyleDifference& diff) const {
1025 if (m_box->zIndex() != other.m_box->zIndex() || 1010 if (m_box->zIndex() != other.m_box->zIndex() ||
1026 isStackingContext() != other.isStackingContext()) 1011 isStackingContext() != other.isStackingContext())
1027 diff.setZIndexChanged(); 1012 diff.setZIndexChanged();
1028 1013
1029 if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) { 1014 if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) {
1030 if (!transformDataEquivalent(other) || 1015 if (!transformDataEquivalent(other) ||
1031 m_rareNonInheritedData->m_perspective != 1016 m_rareNonInheritedData->m_perspective !=
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 diff.setTextDecorationOrColorChanged(); 1091 diff.setTextDecorationOrColorChanged();
1107 } 1092 }
1108 } 1093 }
1109 1094
1110 bool hasClip = hasOutOfFlowPosition() && !m_visual->hasAutoClip; 1095 bool hasClip = hasOutOfFlowPosition() && !m_visual->hasAutoClip;
1111 bool otherHasClip = 1096 bool otherHasClip =
1112 other.hasOutOfFlowPosition() && !other.m_visual->hasAutoClip; 1097 other.hasOutOfFlowPosition() && !other.m_visual->hasAutoClip;
1113 if (hasClip != otherHasClip || 1098 if (hasClip != otherHasClip ||
1114 (hasClip && m_visual->clip != other.m_visual->clip)) 1099 (hasClip && m_visual->clip != other.m_visual->clip))
1115 diff.setCSSClipChanged(); 1100 diff.setCSSClipChanged();
1116
1117 if (scrollAnchorDisablingPropertyChanged(other, diff))
1118 diff.setScrollAnchorDisablingPropertyChanged();
1119 } 1101 }
1120 1102
1121 void ComputedStyle::addPaintImage(StyleImage* image) { 1103 void ComputedStyle::addPaintImage(StyleImage* image) {
1122 if (!m_rareNonInheritedData.access()->m_paintImages) { 1104 if (!m_rareNonInheritedData.access()->m_paintImages) {
1123 m_rareNonInheritedData.access()->m_paintImages = 1105 m_rareNonInheritedData.access()->m_paintImages =
1124 WTF::makeUnique<Vector<Persistent<StyleImage>>>(); 1106 WTF::makeUnique<Vector<Persistent<StyleImage>>>();
1125 } 1107 }
1126 m_rareNonInheritedData.access()->m_paintImages->push_back(image); 1108 m_rareNonInheritedData.access()->m_paintImages->push_back(image);
1127 } 1109 }
1128 1110
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2497 if (value < 0) 2479 if (value < 0)
2498 fvalue -= 0.5f; 2480 fvalue -= 0.5f;
2499 else 2481 else
2500 fvalue += 0.5f; 2482 fvalue += 0.5f;
2501 } 2483 }
2502 2484
2503 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2485 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2504 } 2486 }
2505 2487
2506 } // namespace blink 2488 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/StyleDifference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698