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

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

Issue 1660863002: Force all LayoutUnit construction to be explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also fix LayoutRectTest.cpp Created 4 years, 10 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
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 60c32e64ee104c6820c6dee9d64bd1bfdbc161a6..bcabb7c612c7472a5c57d175118a15132f2fcf3b 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -612,7 +612,7 @@ int Element::offsetLeft()
{
document().updateLayoutIgnorePendingStylesheets();
if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
- return adjustLayoutUnitForAbsoluteZoom(layoutObject->pixelSnappedOffsetLeft(), *layoutObject).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetLeft()), layoutObject->styleRef()).round();
return 0;
}
@@ -620,7 +620,7 @@ int Element::offsetTop()
{
document().updateLayoutIgnorePendingStylesheets();
if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
- return adjustLayoutUnitForAbsoluteZoom(layoutObject->pixelSnappedOffsetTop(), *layoutObject).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetTop()), layoutObject->styleRef()).round();
return 0;
}
@@ -628,7 +628,7 @@ int Element::offsetWidth()
{
document().updateLayoutIgnorePendingStylesheets();
if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
- return adjustLayoutUnitForAbsoluteZoom(layoutObject->pixelSnappedOffsetWidth(), *layoutObject).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetWidth()), layoutObject->styleRef()).round();
return 0;
}
@@ -636,7 +636,7 @@ int Element::offsetHeight()
{
document().updateLayoutIgnorePendingStylesheets();
if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
- return adjustLayoutUnitForAbsoluteZoom(layoutObject->pixelSnappedOffsetHeight(), *layoutObject).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetHeight()), layoutObject->styleRef()).round();
return 0;
}
@@ -663,7 +663,7 @@ int Element::clientLeft()
document().updateLayoutIgnorePendingStylesheets();
if (LayoutBox* layoutObject = layoutBox())
- return adjustLayoutUnitForAbsoluteZoom(roundToInt(layoutObject->clientLeft()), *layoutObject);
+ return adjustLayoutUnitForAbsoluteZoom(layoutObject->clientLeft(), layoutObject->styleRef()).round();
return 0;
}
@@ -672,7 +672,7 @@ int Element::clientTop()
document().updateLayoutIgnorePendingStylesheets();
if (LayoutBox* layoutObject = layoutBox())
- return adjustLayoutUnitForAbsoluteZoom(roundToInt(layoutObject->clientTop()), *layoutObject);
+ return adjustLayoutUnitForAbsoluteZoom(layoutObject->clientTop(), layoutObject->styleRef()).round();
return 0;
}
@@ -687,13 +687,13 @@ int Element::clientWidth()
|| (inQuirksMode && isHTMLElement() && document().body() == this)) {
if (LayoutView* layoutView = document().layoutView()) {
if (document().page()->settings().forceZeroLayoutHeight())
- return adjustLayoutUnitForAbsoluteZoom(layoutView->overflowClipRect(LayoutPoint()).width(), *layoutView);
- return adjustLayoutUnitForAbsoluteZoom(layoutView->layoutSize().width(), *layoutView);
+ return adjustLayoutUnitForAbsoluteZoom(layoutView->overflowClipRect(LayoutPoint()).width(), layoutView->styleRef()).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutView->layoutSize().width()), layoutView->styleRef()).round();
}
}
if (LayoutBox* layoutObject = layoutBox())
- return adjustLayoutUnitForAbsoluteZoom(layoutObject->pixelSnappedClientWidth(), *layoutObject).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedClientWidth()), layoutObject->styleRef()).round();
return 0;
}
@@ -709,13 +709,13 @@ int Element::clientHeight()
|| (inQuirksMode && isHTMLElement() && document().body() == this)) {
if (LayoutView* layoutView = document().layoutView()) {
if (document().page()->settings().forceZeroLayoutHeight())
- return adjustLayoutUnitForAbsoluteZoom(layoutView->overflowClipRect(LayoutPoint()).height(), *layoutView);
- return adjustLayoutUnitForAbsoluteZoom(layoutView->layoutSize().height(), *layoutView);
+ return adjustLayoutUnitForAbsoluteZoom(layoutView->overflowClipRect(LayoutPoint()).height(), layoutView->styleRef()).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutView->layoutSize().height()), layoutView->styleRef()).round();
}
}
if (LayoutBox* layoutObject = layoutBox())
- return adjustLayoutUnitForAbsoluteZoom(layoutObject->pixelSnappedClientHeight(), *layoutObject).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedClientHeight()), layoutObject->styleRef()).round();
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698