Chromium Code Reviews| 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 77e51203bd9007570bb39f0a6dfe8bc599cd508a..f61f7b41bc3765ad04061059c6c007a878a93841 100644 |
| --- a/third_party/WebKit/Source/core/dom/Element.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Element.cpp |
| @@ -429,7 +429,7 @@ bool Element::shouldIgnoreAttributeCase() const { |
| } |
| void Element::scrollIntoView(bool alignToTop) { |
| - document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| + ensureCompositingInputsClean(); |
| if (!layoutObject()) |
| return; |
| @@ -454,7 +454,7 @@ void Element::scrollIntoView(bool alignToTop) { |
| } |
| void Element::scrollIntoViewIfNeeded(bool centerIfNeeded) { |
| - document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| + ensureCompositingInputsClean(); |
| if (!layoutObject()) |
| return; |
| @@ -634,7 +634,7 @@ void Element::callApplyScroll(ScrollState& scrollState) { |
| } |
| int Element::offsetLeft() { |
| - document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| + ensureCompositingInputsClean(); |
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| return adjustLayoutUnitForAbsoluteZoom( |
| LayoutUnit(layoutObject->pixelSnappedOffsetLeft(offsetParent())), |
| @@ -644,7 +644,7 @@ int Element::offsetLeft() { |
| } |
| int Element::offsetTop() { |
| - document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| + ensureCompositingInputsClean(); |
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| return adjustLayoutUnitForAbsoluteZoom( |
| LayoutUnit(layoutObject->pixelSnappedOffsetTop(offsetParent())), |
| @@ -1119,7 +1119,7 @@ IntRect Element::visibleBoundsInVisualViewport() const { |
| } |
| void Element::clientQuads(Vector<FloatQuad>& quads) { |
| - document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| + ensureCompositingInputsClean(); |
| LayoutObject* elementLayoutObject = layoutObject(); |
| if (!elementLayoutObject) |
| @@ -4119,6 +4119,19 @@ void Element::logUpdateAttributeIfIsolatedWorldAndInDocument( |
| activityLogger->logEvent("blinkSetAttribute", argv.size(), argv.data()); |
| } |
| +void Element::ensureCompositingInputsClean() { |
| + if (!inActiveDocument()) |
| + return; |
| + |
| + // The call to updateLifecycleToCompositingCleanPlusScrolling| below would |
| + // also run layout for us if we omitted this call. However we do not want to |
| + // include pending style sheets when doing the layout, hence this call. |
| + document().updateStyleAndLayoutIgnorePendingStylesheets(); |
|
chrishtr
2017/01/25 21:36:28
Previously it was updateStyleAndLayoutIgnorePendin
smcgruer
2017/01/25 21:39:05
All updateStyleAndLayoutIgnorePendingStylesheetsFo
chrishtr
2017/01/25 22:18:56
Oh ok.
|
| + |
| + if (FrameView* view = document().view()) |
| + view->updateLifecycleToCompositingCleanPlusScrolling(); |
| +} |
| + |
| DEFINE_TRACE(Element) { |
| if (hasRareData()) |
| visitor->trace(elementRareData()); |