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

Unified Diff: third_party/WebKit/Source/core/html/HTMLElement.cpp

Issue 2126713003: Fix layout object lifecycle in HTMLElement.offset* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update layout test for comments Created 4 years, 5 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/LayoutTests/shadow-dom/crashes/offsetParent-layoutObject-lifecycle.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp
index 9ad44bc51ab4e5e494a0f973a5e9836cd8eac6d6..5160f5997a47727687f9a980d6fa1c2a4fe33d7f 100644
--- a/third_party/WebKit/Source/core/html/HTMLElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -1054,33 +1054,33 @@ const AtomicString& HTMLElement::eventParameterName()
int HTMLElement::offsetLeftForBinding()
{
- document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
+ Element* offsetParent = unclosedOffsetParent();
if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
- return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetLeft(unclosedOffsetParent())), layoutObject->styleRef()).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetLeft(offsetParent)), layoutObject->styleRef()).round();
return 0;
}
int HTMLElement::offsetTopForBinding()
{
- document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
+ Element* offsetParent = unclosedOffsetParent();
if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
- return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetTop(unclosedOffsetParent())), layoutObject->styleRef()).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetTop(offsetParent)), layoutObject->styleRef()).round();
return 0;
}
int HTMLElement::offsetWidthForBinding()
{
- document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
+ Element* offsetParent = unclosedOffsetParent();
if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
- return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetWidth(unclosedOffsetParent())), layoutObject->styleRef()).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetWidth(offsetParent)), layoutObject->styleRef()).round();
return 0;
}
int HTMLElement::offsetHeightForBinding()
{
- document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
+ Element* offsetParent = unclosedOffsetParent();
if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
- return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetHeight(unclosedOffsetParent())), layoutObject->styleRef()).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetHeight(offsetParent)), layoutObject->styleRef()).round();
return 0;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/crashes/offsetParent-layoutObject-lifecycle.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698