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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2728383002: Make ::first-line invalidation work when added or removed. (Closed)
Patch Set: Fixed review issues. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index f33de88828625bc869a80e4e0fb9c2575863396d..e1cbf151fe88f7bbdf108b79356b814a4212a9a5 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1808,47 +1808,6 @@ void Element::detachLayoutTree(const AttachContext& context) {
DCHECK(needsAttach());
}
-void Element::pseudoStyleCacheIsInvalid(const ComputedStyle* currentStyle,
- ComputedStyle* newStyle) {
- // TODO(rune@opera.com): This method does not take into account pseudo style
- // which is only present for the newStyle. Also the first-line part should
- // probably be moved to where we handle visual invalidation diff for setStyle.
- // setHasPseudoStyle() calls are probably unnecessary.
- DCHECK_EQ(currentStyle, computedStyle());
- DCHECK(layoutObject());
-
- if (!currentStyle)
- return;
-
- const PseudoStyleCache* pseudoStyleCache = currentStyle->cachedPseudoStyles();
- if (!pseudoStyleCache)
- return;
-
- size_t cacheSize = pseudoStyleCache->size();
- for (size_t i = 0; i < cacheSize; ++i) {
- RefPtr<ComputedStyle> newPseudoStyle;
- RefPtr<ComputedStyle> oldPseudoStyle = pseudoStyleCache->at(i);
- PseudoId pseudoId = oldPseudoStyle->styleType();
- if (pseudoId != PseudoIdFirstLine && pseudoId != PseudoIdFirstLineInherited)
- continue;
- newPseudoStyle = layoutObject()->uncachedFirstLineStyle(newStyle);
- if (!newPseudoStyle)
- continue;
- if (*oldPseudoStyle != *newPseudoStyle ||
- oldPseudoStyle->font().loadingCustomFonts() !=
- newPseudoStyle->font().loadingCustomFonts()) {
- if (pseudoId < FirstInternalPseudoId)
- newStyle->setHasPseudoStyle(pseudoId);
- newStyle->addCachedPseudoStyle(newPseudoStyle);
- if (pseudoId == PseudoIdFirstLine ||
- pseudoId == PseudoIdFirstLineInherited) {
- layoutObject()->firstLineStyleDidChange(*oldPseudoStyle,
- *newPseudoStyle);
- }
- }
- }
-}
-
PassRefPtr<ComputedStyle> Element::styleForLayoutObject() {
DCHECK(document().inStyleRecalc());
@@ -2036,7 +1995,6 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change,
if (LayoutObject* layoutObject = this->layoutObject()) {
if (localChange != NoChange) {
- pseudoStyleCacheIsInvalid(oldStyle.get(), newStyle.get());
layoutObject->setStyle(newStyle.get());
} else {
// Although no change occurred, we use the new style so that the cousin
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698