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

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

Issue 1209253006: Need to update first-line when font finish loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review issue fix and virtual suite rebaseline. Created 5 years, 6 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 | « LayoutTests/TestExpectations ('k') | Source/core/layout/LayoutObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index c69348e34641b001dad546df2a175dd3c422cf6d..8d6b05fc1b8482d232e106104829af7e983ec578 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1540,23 +1540,20 @@ bool Element::pseudoStyleCacheIsInvalid(const ComputedStyle* currentStyle, Compu
size_t cacheSize = pseudoStyleCache->size();
for (size_t i = 0; i < cacheSize; ++i) {
RefPtr<ComputedStyle> newPseudoStyle;
- PseudoId pseudoId = pseudoStyleCache->at(i)->styleType();
+ RefPtr<ComputedStyle> oldPseudoStyle = pseudoStyleCache->at(i);
+ PseudoId pseudoId = oldPseudoStyle->styleType();
if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED)
newPseudoStyle = layoutObject()->uncachedFirstLineStyle(newStyle);
else
newPseudoStyle = layoutObject()->getUncachedPseudoStyle(PseudoStyleRequest(pseudoId), newStyle, newStyle);
if (!newPseudoStyle)
return true;
- if (*newPseudoStyle != *pseudoStyleCache->at(i)) {
+ if (*oldPseudoStyle != *newPseudoStyle || oldPseudoStyle->font().loadingCustomFonts() != newPseudoStyle->font().loadingCustomFonts()) {
if (pseudoId < FIRST_INTERNAL_PSEUDOID)
newStyle->setHasPseudoStyle(pseudoId);
newStyle->addCachedPseudoStyle(newPseudoStyle);
- if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED) {
- // FIXME: We should do an actual diff to determine whether a repaint vs. layout
- // is needed, but for now just assume a layout will be required. The diff code
- // in LayoutObject::setStyle would need to be factored out so that it could be reused.
- layoutObject()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::StyleChange);
- }
+ if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED)
+ layoutObject()->firstLineStyleDidChange(*oldPseudoStyle, *newPseudoStyle);
return true;
}
}
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698