Commit 16985db4 authored by rniwa@webkit.org's avatar rniwa@webkit.org

REGRESSION(r154614): Opening and closing a picture on Facebook resets scroll position

https://bugs.webkit.org/show_bug.cgi?id=122882

Reviewed by Anders Carlsson.

Source/WebCore:

scrollLeft and scrollTop have to continue to function in the strict mode for the Web compatiblity.
In particular, www.facebook.com and build.webkit.org depend on this behavior as of October 29th, 2013.

* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::setScrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
(WebCore::HTMLBodyElement::setScrollTop):

LayoutTests:

* fast/dom/Element/body-scrollLeft-expected.txt:
* fast/dom/Element/body-scrollLeft.html:
* fast/dom/Element/body-scrollTop-expected.txt:
* fast/dom/Element/body-scrollTop.html:
* fast/dom/Element/scrollLeft-expected.txt:
* fast/dom/Element/scrollLeft.html:
* fast/dom/Element/scrollTop-expected.txt:
* fast/dom/Element/scrollTop.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 473bac21
2013-10-29 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r154614): Opening and closing a picture on Facebook resets scroll position
https://bugs.webkit.org/show_bug.cgi?id=122882
Reviewed by Anders Carlsson.
* fast/dom/Element/body-scrollLeft-expected.txt:
* fast/dom/Element/body-scrollLeft.html:
* fast/dom/Element/body-scrollTop-expected.txt:
* fast/dom/Element/body-scrollTop.html:
* fast/dom/Element/scrollLeft-expected.txt:
* fast/dom/Element/scrollLeft.html:
* fast/dom/Element/scrollTop-expected.txt:
* fast/dom/Element/scrollTop.html:
2013-10-29 Ryosuke Niwa <rniwa@webkit.org>
Update Mavericks test expectation, tracked by bugs 123489 and 123490.
......
......@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS successfullyParsed is true
TEST COMPLETE
PASS document.body.scrollLeft is 0
PASS document.body.scrollLeft is 500
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -13,7 +13,7 @@
description('Tests that for non-standard mode document.body.scrollLeft returns the scroll left value as 0');
document.body.scrollLeft = 500;
shouldBe("document.body.scrollLeft","0");
shouldBe("document.body.scrollLeft","500");
isSuccessfullyParsed();
}
</script>
......
......@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS successfullyParsed is true
TEST COMPLETE
PASS document.body.scrollTop is 0
PASS document.body.scrollTop is 500
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -13,7 +13,7 @@
description('Tests that for non-standard mode document.body.scrollTop returns the scroll top value as 0');
document.body.scrollTop = 500;
shouldBe("document.body.scrollTop","0");
shouldBe("document.body.scrollTop","500");
isSuccessfullyParsed();
}
</script>
......
......@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS window.pageXOffset is 500
PASS document.body.scrollLeft is 0
PASS document.body.scrollLeft is 500
PASS document.documentElement.scrollLeft is 500
PASS successfullyParsed is true
......
......@@ -15,7 +15,7 @@
setTimeout(function() {
window.scrollTo(500,0);
shouldBe("window.pageXOffset","500");
shouldBe("document.body.scrollLeft","0");
shouldBe("document.body.scrollLeft","500");
shouldBe("document.documentElement.scrollLeft","500");
finishJSTest();
}, 0);
......
......@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS window.pageYOffset is 500
PASS document.body.scrollTop is 0
PASS document.body.scrollTop is 500
PASS document.documentElement.scrollTop is 500
PASS successfullyParsed is true
......
......@@ -15,7 +15,7 @@
setTimeout(function() {
window.scrollTo(0,500);
shouldBe("window.pageYOffset","500");
shouldBe("document.body.scrollTop","0");
shouldBe("document.body.scrollTop","500");
shouldBe("document.documentElement.scrollTop","500");
finishJSTest();
}, 0);
......
2013-10-29 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r154614): Opening and closing a picture on Facebook resets scroll position
https://bugs.webkit.org/show_bug.cgi?id=122882
Reviewed by Anders Carlsson.
scrollLeft and scrollTop have to continue to function in the strict mode for the Web compatiblity.
In particular, www.facebook.com and build.webkit.org depend on this behavior as of October 29th, 2013.
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::setScrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
(WebCore::HTMLBodyElement::setScrollTop):
2013-10-29 Brady Eidson <beidson@apple.com>
IDBTransactionBackend should be cross platform
......
......@@ -251,8 +251,6 @@ static int adjustForZoom(int value, Frame& frame)
int HTMLBodyElement::scrollLeft()
{
if (!document().inQuirksMode())
return 0;
document().updateLayoutIgnorePendingStylesheets();
Frame* frame = document().frame();
if (!frame)
......@@ -265,9 +263,6 @@ int HTMLBodyElement::scrollLeft()
void HTMLBodyElement::setScrollLeft(int scrollLeft)
{
if (!document().inQuirksMode())
return;
document().updateLayoutIgnorePendingStylesheets();
Frame* frame = document().frame();
if (!frame)
......@@ -280,8 +275,6 @@ void HTMLBodyElement::setScrollLeft(int scrollLeft)
int HTMLBodyElement::scrollTop()
{
if (!document().inQuirksMode())
return 0;
document().updateLayoutIgnorePendingStylesheets();
Frame* frame = document().frame();
if (!frame)
......@@ -294,9 +287,6 @@ int HTMLBodyElement::scrollTop()
void HTMLBodyElement::setScrollTop(int scrollTop)
{
if (!document().inQuirksMode())
return;
document().updateLayoutIgnorePendingStylesheets();
Frame* frame = document().frame();
if (!frame)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment