Chromium Code Reviews| Index: Source/core/dom/Element.cpp |
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
| index 295cd9fbd11ba889a4b3ea5cb7741a1f3759ccc6..fc9327d408afbc15ad84f4bf41637b1a66d1a9af 100644 |
| --- a/Source/core/dom/Element.cpp |
| +++ b/Source/core/dom/Element.cpp |
| @@ -724,6 +724,20 @@ int Element::scrollTop() |
| void Element::setScrollLeft(int newLeft) |
| { |
| document().updateLayoutIgnorePendingStylesheets(); |
| + |
| + if (document().documentElement() == this) { |
| + if (document().inQuirksMode()) |
| + return; |
| + |
| + Frame* frame = document().frame(); |
| + if (!frame) |
| + return; |
| + FrameView* view = frame->view(); |
| + if (!view) |
| + return; |
| + view->setScrollPosition(IntPoint(static_cast<int>(newLeft * frame->pageZoomFactor()), view->scrollY())); |
|
Julien - ping for review
2013/10/05 01:05:46
The specification is weird and seem to imply that
|
| + } |
| + |
| if (RenderBox* rend = renderBox()) |
| rend->setScrollLeft(static_cast<int>(newLeft * rend->style()->effectiveZoom())); |
| } |
| @@ -731,6 +745,20 @@ void Element::setScrollLeft(int newLeft) |
| void Element::setScrollTop(int newTop) |
| { |
| document().updateLayoutIgnorePendingStylesheets(); |
| + |
| + if (document().documentElement() == this) { |
| + if (document().inQuirksMode()) |
| + return; |
| + |
| + Frame* frame = document().frame(); |
| + if (!frame) |
| + return; |
| + FrameView* view = frame->view(); |
| + if (!view) |
| + return; |
| + view->setScrollPosition(IntPoint(view->scrollX(), static_cast<int>(newTop * frame->pageZoomFactor()))); |
| + } |
| + |
| if (RenderBox* rend = renderBox()) |
| rend->setScrollTop(static_cast<int>(newTop * rend->style()->effectiveZoom())); |
| } |