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

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

Issue 2752163003: Clear pseudoElement from ElementRareData when FirstLetterPseudoElement doesn't have a LayoutObject (Closed)
Patch Set: 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
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 cde1c106f18ac2c7486d7dc8bb4f209158ab2c4d..289bda48179fd9e5245de153c5f91aa143aa1404 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2062,8 +2062,11 @@ void Element::rebuildShadowRootLayoutTree() {
void Element::reattachPseudoElementLayoutTree(PseudoId pseudoId) {
if (PseudoElement* element = pseudoElement(pseudoId)) {
- if (element->needsReattachLayoutTree() ||
nainar 2017/03/17 23:47:40 Change as per discussed by esprehn@ and I in IRL:
- element->childNeedsReattachLayoutTree())
+ if (pseudoId == PseudoIdFirstLetter &&
+ !FirstLetterPseudoElement::firstLetterTextLayoutObject(*element))
+ elementRareData()->setPseudoElement(pseudoId, nullptr);
+ else if (element->needsReattachLayoutTree() ||
esprehn 2017/04/06 00:08:59 I think we often add braces when things start to g
nainar 2017/04/06 00:20:45 Done.
+ element->childNeedsReattachLayoutTree())
element->rebuildLayoutTree();
} else {
createPseudoElementIfNeeded(pseudoId);

Powered by Google App Engine
This is Rietveld 408576698