Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1411)

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2647533002: Force compositing inputs to be clean for getBoundingClientRect (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698