| 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 dde22c864e3e8c69e3a0d326fb5b214babe2bcc5..eb9f8b0bd53da4d62b3319c1e6604d0869563e71 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)
|
| @@ -4120,6 +4120,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();
|
| +
|
| + if (FrameView* view = document().view())
|
| + view->updateLifecycleToCompositingCleanPlusScrolling();
|
| +}
|
| +
|
| DEFINE_TRACE(Element) {
|
| if (hasRareData())
|
| visitor->trace(elementRareData());
|
|
|