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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2768053003: Get rid of ownStyle in LayoutObject::getUncachedPseudoStyle. (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/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index e0ce2763815212db5fd5cbbc3ee6b5bf4cf95dff..b04f1c39ed151e022a395cf3e8d8ad88ee1051e8 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1959,8 +1959,7 @@ void LayoutObject::applyFirstLineChanges(const ComputedStyle& oldStyle) {
RefPtr<ComputedStyle> oldPseudoStyle =
oldStyle.getCachedPseudoStyle(PseudoIdFirstLine);
if (styleRef().hasPseudoStyle(PseudoIdFirstLine) && oldPseudoStyle) {
- RefPtr<ComputedStyle> newPseudoStyle =
- uncachedFirstLineStyle(mutableStyle());
+ RefPtr<ComputedStyle> newPseudoStyle = uncachedFirstLineStyle();
if (newPseudoStyle) {
firstLineStyleDidChange(*oldPseudoStyle, *newPseudoStyle);
return;
@@ -3031,8 +3030,7 @@ static PassRefPtr<ComputedStyle> firstLineStyleForCachedUncachedType(
if (type == Cached)
return firstLineBlock->getCachedPseudoStyle(PseudoIdFirstLine, style);
return firstLineBlock->getUncachedPseudoStyle(
- PseudoStyleRequest(PseudoIdFirstLine), style,
- firstLineBlock == layoutObject ? style : 0);
+ PseudoStyleRequest(PseudoIdFirstLine), style);
}
} else if (!layoutObjectForFirstLineStyle->isAnonymous() &&
layoutObjectForFirstLineStyle->isLayoutInline() &&
@@ -3050,20 +3048,19 @@ static PassRefPtr<ComputedStyle> firstLineStyleForCachedUncachedType(
PseudoIdFirstLineInherited, parentStyle);
}
return layoutObjectForFirstLineStyle->getUncachedPseudoStyle(
- PseudoStyleRequest(PseudoIdFirstLineInherited), parentStyle, style);
+ PseudoStyleRequest(PseudoIdFirstLineInherited), parentStyle);
}
}
return nullptr;
}
-PassRefPtr<ComputedStyle> LayoutObject::uncachedFirstLineStyle(
- ComputedStyle* style) const {
+PassRefPtr<ComputedStyle> LayoutObject::uncachedFirstLineStyle() const {
if (!document().styleEngine().usesFirstLineRules())
return nullptr;
ASSERT(!isText());
- return firstLineStyleForCachedUncachedType(Uncached, this, style);
+ return firstLineStyleForCachedUncachedType(Uncached, this, m_style.get());
}
ComputedStyle* LayoutObject::cachedFirstLineStyle() const {
@@ -3095,16 +3092,13 @@ ComputedStyle* LayoutObject::getCachedPseudoStyle(
PassRefPtr<ComputedStyle> LayoutObject::getUncachedPseudoStyle(
const PseudoStyleRequest& pseudoStyleRequest,
- const ComputedStyle* parentStyle,
- const ComputedStyle* ownStyle) const {
- if (pseudoStyleRequest.pseudoId < FirstInternalPseudoId && !ownStyle &&
+ const ComputedStyle* parentStyle) const {
+ if (pseudoStyleRequest.pseudoId < FirstInternalPseudoId &&
!style()->hasPseudoStyle(pseudoStyleRequest.pseudoId))
rune 2017/03/23 22:57:46 I'm not sure I understand this code, but it looks
return nullptr;
- if (!parentStyle) {
- ASSERT(!ownStyle);
+ if (!parentStyle)
parentStyle = style();
- }
if (!node())
return nullptr;
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/api/LayoutItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698