Chromium Code Reviews| Index: Source/core/dom/Element.cpp |
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
| index 7d79c4509285dd9a56b10a3a931230cbccdaa47d..f71b1d2ed88d80c309ff7e5dcc3e2dd0a51a1c76 100644 |
| --- a/Source/core/dom/Element.cpp |
| +++ b/Source/core/dom/Element.cpp |
| @@ -685,6 +685,18 @@ int Element::clientHeight() |
| int Element::scrollLeft() |
| { |
| document().updateLayoutIgnorePendingStylesheets(); |
| + |
| + bool inQuirksMode = document().inQuirksMode(); |
|
Julien - ping for review
2013/09/30 23:39:57
For consistency, this should be moved inside the b
tonikitoo_
2013/10/01 14:42:17
Ok
|
| + if (document().documentElement() == this) { |
| + if (inQuirksMode) |
| + return 0; |
| + |
| + if (FrameView* view = document().view()) { |
| + if (RenderView* renderView = document().renderView()) |
| + return adjustForAbsoluteZoom(view->scrollX(), renderView); |
|
Julien - ping for review
2013/09/30 23:39:57
It would be nice to have some zoom testing too.
tonikitoo_
2013/10/01 14:42:17
Do you think the test this patch edits in LayoutTe
Julien - ping for review
2013/10/01 15:19:51
I missed this test which exercise this code, my ba
tonikitoo_
2013/10/01 16:49:19
In fact, it changes the test fine. The expected re
|
| + } |
| + } |
| + |
| if (RenderBox* rend = renderBox()) |
| return adjustForAbsoluteZoom(rend->scrollLeft(), rend); |
| return 0; |
| @@ -693,6 +705,17 @@ int Element::scrollLeft() |
| int Element::scrollTop() |
| { |
| document().updateLayoutIgnorePendingStylesheets(); |
| + |
| + if (document().documentElement() == this) { |
| + if (document().inQuirksMode()) |
| + return 0; |
| + |
| + if (FrameView* view = document().view()) { |
| + if (RenderView* renderView = document().renderView()) |
| + return adjustForAbsoluteZoom(view->scrollY(), renderView); |
| + } |
| + } |
| + |
| if (RenderBox* rend = renderBox()) |
| return adjustForAbsoluteZoom(rend->scrollTop(), rend); |
| return 0; |