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

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

Issue 2732113002: Move ::selection invalidation to applyPseudoStyleChanges. (Closed)
Patch Set: Rebased Created 3 years, 9 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 if (dependenceOnContentHeightHasChanged(*this, other)) 573 if (dependenceOnContentHeightHasChanged(*this, other))
574 diff.setNeedsFullLayout(); 574 diff.setNeedsFullLayout();
575 else 575 else
576 diff.setNeedsPositionedMovementLayout(); 576 diff.setNeedsPositionedMovementLayout();
577 } 577 }
578 578
579 if (diffNeedsPaintInvalidationSubtree(other)) 579 if (diffNeedsPaintInvalidationSubtree(other))
580 diff.setNeedsPaintInvalidationSubtree(); 580 diff.setNeedsPaintInvalidationSubtree();
581 else if (diffNeedsPaintInvalidationObject(other)) 581 else if (diffNeedsPaintInvalidationObject(other))
582 diff.setNeedsPaintInvalidationObject(); 582 diff.setNeedsPaintInvalidationObject();
583 else if (diffNeedsPaintInvalidationSelection(other))
584 diff.setNeedsPaintInvalidationSelection();
585 583
586 updatePropertySpecificDifferences(other, diff); 584 updatePropertySpecificDifferences(other, diff);
587 585
588 // The following condition needs to be at last, because it may depend on 586 // The following condition needs to be at last, because it may depend on
589 // conditions in diff computed above. 587 // conditions in diff computed above.
590 if (scrollAnchorDisablingPropertyChanged(other, diff)) 588 if (scrollAnchorDisablingPropertyChanged(other, diff))
591 diff.setScrollAnchorDisablingPropertyChanged(); 589 diff.setScrollAnchorDisablingPropertyChanged();
592 590
593 // Cursors are not checked, since they will be set appropriately in response 591 // Cursors are not checked, since they will be set appropriately in response
594 // to mouse events, so they don't need to cause any paint invalidation or 592 // to mouse events, so they don't need to cause any paint invalidation or
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 for (const AtomicString& property : 1019 for (const AtomicString& property :
1022 *value->customInvalidationProperties()) { 1020 *value->customInvalidationProperties()) {
1023 if (!dataEquivalent(getVariable(property), other.getVariable(property))) 1021 if (!dataEquivalent(getVariable(property), other.getVariable(property)))
1024 return true; 1022 return true;
1025 } 1023 }
1026 } 1024 }
1027 1025
1028 return false; 1026 return false;
1029 } 1027 }
1030 1028
1031 bool ComputedStyle::diffNeedsPaintInvalidationSelection(
1032 const ComputedStyle& other) const {
1033 return hasPseudoStyle(PseudoIdSelection) ||
1034 other.hasPseudoStyle(PseudoIdSelection);
1035 }
1036
1037 void ComputedStyle::updatePropertySpecificDifferences( 1029 void ComputedStyle::updatePropertySpecificDifferences(
1038 const ComputedStyle& other, 1030 const ComputedStyle& other,
1039 StyleDifference& diff) const { 1031 StyleDifference& diff) const {
1040 if (m_box->zIndex() != other.m_box->zIndex() || 1032 if (m_box->zIndex() != other.m_box->zIndex() ||
1041 isStackingContext() != other.isStackingContext()) 1033 isStackingContext() != other.isStackingContext())
1042 diff.setZIndexChanged(); 1034 diff.setZIndexChanged();
1043 1035
1044 if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) { 1036 if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) {
1045 if (!transformDataEquivalent(other) || 1037 if (!transformDataEquivalent(other) ||
1046 m_rareNonInheritedData->m_perspective != 1038 m_rareNonInheritedData->m_perspective !=
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2498 if (value < 0) 2490 if (value < 0)
2499 fvalue -= 0.5f; 2491 fvalue -= 0.5f;
2500 else 2492 else
2501 fvalue += 0.5f; 2493 fvalue += 0.5f;
2502 } 2494 }
2503 2495
2504 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2496 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2505 } 2497 }
2506 2498
2507 } // namespace blink 2499 } // 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