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 d5ea539ee3527b4a3f90bb8e3b32abb76b499bdf..9f392033f38ddb498a114a89ace14c109414199f 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) |
| @@ -4122,6 +4122,16 @@ void Element::logUpdateAttributeIfIsolatedWorldAndInDocument( |
| activityLogger->logEvent("blinkSetAttribute", argv.size(), argv.data()); |
| } |
| +void Element::ensureCompositingInputsClean() { |
| + if (!inActiveDocument()) |
| + return; |
| + |
| + document().updateStyleAndLayoutIgnorePendingStylesheets(); |
|
flackr
2017/01/23 16:43:50
It's probably worth adding a comment for why we ne
smcgruer
2017/01/24 15:26:30
Done.
|
| + |
| + if (FrameView* view = document().view()) |
| + view->updateLifecycleToCompositingCleanPlusScrolling(); |
| +} |
| + |
| DEFINE_TRACE(Element) { |
| if (hasRareData()) |
| visitor->trace(elementRareData()); |