| 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..d1662218e0fd9be3d58c6865f9ad819e200b666e 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| @@ -3084,30 +3084,23 @@ ComputedStyle* LayoutObject::cachedFirstLineStyle() const {
|
| ComputedStyle* LayoutObject::getCachedPseudoStyle(
|
| PseudoId pseudo,
|
| const ComputedStyle* parentStyle) const {
|
| - if (pseudo < FirstInternalPseudoId && !style()->hasPseudoStyle(pseudo))
|
| + DCHECK_NE(pseudo, PseudoIdBefore);
|
| + DCHECK_NE(pseudo, PseudoIdAfter);
|
| + if (!node())
|
| return nullptr;
|
|
|
| - ComputedStyle* cachedStyle = style()->getCachedPseudoStyle(pseudo);
|
| - if (cachedStyle)
|
| - return cachedStyle;
|
| + Element* element = Traversal<Element>::firstAncestorOrSelf(*node());
|
| + if (!element)
|
| + return nullptr;
|
|
|
| - RefPtr<ComputedStyle> result =
|
| - getUncachedPseudoStyle(PseudoStyleRequest(pseudo), parentStyle);
|
| - if (result)
|
| - return mutableStyleRef().addCachedPseudoStyle(result.release());
|
| - return nullptr;
|
| + return element->pseudoStyle(PseudoStyleRequest(pseudo), parentStyle);
|
| }
|
|
|
| PassRefPtr<ComputedStyle> LayoutObject::getUncachedPseudoStyle(
|
| - const PseudoStyleRequest& pseudoStyleRequest,
|
| + const PseudoStyleRequest& request,
|
| const ComputedStyle* parentStyle) const {
|
| - if (pseudoStyleRequest.pseudoId < FirstInternalPseudoId &&
|
| - !style()->hasPseudoStyle(pseudoStyleRequest.pseudoId))
|
| - return nullptr;
|
| -
|
| - if (!parentStyle)
|
| - parentStyle = style();
|
| -
|
| + DCHECK_NE(request.pseudoId, PseudoIdBefore);
|
| + DCHECK_NE(request.pseudoId, PseudoIdAfter);
|
| if (!node())
|
| return nullptr;
|
|
|
| @@ -3115,16 +3108,7 @@ PassRefPtr<ComputedStyle> LayoutObject::getUncachedPseudoStyle(
|
| if (!element)
|
| return nullptr;
|
|
|
| - if (pseudoStyleRequest.pseudoId == PseudoIdFirstLineInherited) {
|
| - RefPtr<ComputedStyle> result =
|
| - document().ensureStyleResolver().styleForElement(
|
| - element, parentStyle, parentStyle, DisallowStyleSharing);
|
| - result->setStyleType(PseudoIdFirstLineInherited);
|
| - return result.release();
|
| - }
|
| -
|
| - return document().ensureStyleResolver().pseudoStyleForElement(
|
| - element, pseudoStyleRequest, parentStyle, parentStyle);
|
| + return element->getUncachedPseudoStyle(request, parentStyle);
|
| }
|
|
|
| PassRefPtr<ComputedStyle> LayoutObject::getUncachedSelectionStyle() const {
|
|
|