| 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 354e11b3a7aa04a8e1fa8faea0f727396b1674c7..b32332c3a4394117cbcd18b9a296c47818be4235 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| @@ -3027,39 +3027,10 @@ static PassRefPtr<ComputedStyle> firstLineStyleForCachedUncachedType(
|
| StyleCacheState type,
|
| const LayoutObject* layoutObject,
|
| ComputedStyle* style) {
|
| - const LayoutObject* layoutObjectForFirstLineStyle = layoutObject;
|
| - if (layoutObject->isBeforeOrAfterContent())
|
| - layoutObjectForFirstLineStyle = layoutObject->parent();
|
| -
|
| - if (layoutObjectForFirstLineStyle->behavesLikeBlockContainer()) {
|
| - if (const LayoutBlock* firstLineBlock =
|
| - toLayoutBlock(layoutObjectForFirstLineStyle)
|
| - ->enclosingFirstLineStyleBlock()) {
|
| - if (type == Cached)
|
| - return firstLineBlock->getCachedPseudoStyle(PseudoIdFirstLine, style);
|
| - return firstLineBlock->getUncachedPseudoStyle(
|
| - PseudoStyleRequest(PseudoIdFirstLine), style);
|
| - }
|
| - } else if (!layoutObjectForFirstLineStyle->isAnonymous() &&
|
| - layoutObjectForFirstLineStyle->isLayoutInline() &&
|
| - !layoutObjectForFirstLineStyle->node()
|
| - ->isFirstLetterPseudoElement()) {
|
| - const ComputedStyle* parentStyle =
|
| - layoutObjectForFirstLineStyle->parent()->firstLineStyle();
|
| - if (parentStyle != layoutObjectForFirstLineStyle->parent()->style()) {
|
| - if (type == Cached) {
|
| - // A first-line style is in effect. Cache a first-line style for
|
| - // ourselves.
|
| - layoutObjectForFirstLineStyle->mutableStyleRef().setHasPseudoStyle(
|
| - PseudoIdFirstLineInherited);
|
| - return layoutObjectForFirstLineStyle->getCachedPseudoStyle(
|
| - PseudoIdFirstLineInherited, parentStyle);
|
| - }
|
| - return layoutObjectForFirstLineStyle->getUncachedPseudoStyle(
|
| - PseudoStyleRequest(PseudoIdFirstLineInherited), parentStyle);
|
| - }
|
| - }
|
| - return nullptr;
|
| + return type == Cached
|
| + ? layoutObject->getCachedPseudoStyle(PseudoIdFirstLine, style)
|
| + : layoutObject->getUncachedPseudoStyle(
|
| + PseudoStyleRequest(PseudoIdFirstLine), style);
|
| }
|
|
|
| PassRefPtr<ComputedStyle> LayoutObject::uncachedFirstLineStyle() const {
|
| @@ -3074,8 +3045,8 @@ PassRefPtr<ComputedStyle> LayoutObject::uncachedFirstLineStyle() const {
|
| ComputedStyle* LayoutObject::cachedFirstLineStyle() const {
|
| ASSERT(document().styleEngine().usesFirstLineRules());
|
|
|
| - if (RefPtr<ComputedStyle> style = firstLineStyleForCachedUncachedType(
|
| - Cached, isText() ? parent() : this, m_style.get()))
|
| + if (RefPtr<ComputedStyle> style =
|
| + firstLineStyleForCachedUncachedType(Cached, this, m_style.get()))
|
| return style.get();
|
|
|
| return m_style.get();
|
|
|