Diff
Modified: trunk/LayoutTests/ChangeLog (87801 => 87802)
--- trunk/LayoutTests/ChangeLog 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/LayoutTests/ChangeLog 2011-06-01 14:11:23 UTC (rev 87802)
@@ -1,3 +1,24 @@
+2011-06-01 Shishir Agrawal <[email protected]>
+
+ Reviewed by Tony Gentilcore.
+
+ Renaming the Page Visibility attributes as per the modified spec draft.
+ https://bugs.webkit.org/show_bug.cgi?id=61825
+
+ Spec draft:
+ http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html
+
+ - Event needs to be webkitVisibilityChange from webkitVisibilityStateChange
+ - The attribute webkitIsVisible needs to change to webkitHidden
+
+ * fast/events/page-visibility-iframe-delete-test.html:
+ * fast/events/page-visibility-iframe-move-test-expected.txt:
+ * fast/events/page-visibility-iframe-move-test.html:
+ * fast/events/page-visibility-iframe-propagation-test-expected.txt:
+ * fast/events/page-visibility-iframe-propagation-test.html:
+ * fast/events/page-visibility-transition-test-expected.txt:
+ * fast/events/page-visibility-transition-test.html:
+
2011-06-01 Gabor Loki <[email protected]>
Rubber-stamped by Csaba Osztrogonác.
Modified: trunk/LayoutTests/fast/events/page-visibility-iframe-delete-test.html (87801 => 87802)
--- trunk/LayoutTests/fast/events/page-visibility-iframe-delete-test.html 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/LayoutTests/fast/events/page-visibility-iframe-delete-test.html 2011-06-01 14:11:23 UTC (rev 87802)
@@ -35,9 +35,9 @@
subFrame2 = frame3.contentDocument.getElementById("subIframe2");
document.addEventListener(
- "webkitvisibilitystatechange", onMainPageVisibilityChange, false);
+ "webkitvisibilitychange", onMainPageVisibilityChange, false);
frame2.contentDocument.addEventListener(
- "webkitvisibilitystatechange", onFrame2VisibilityChange, false);
+ "webkitvisibilitychange", onFrame2VisibilityChange, false);
// Change the visibility of the current page to invisible.
if (window.layoutTestController) {
numVisibilityChanges++;
Modified: trunk/LayoutTests/fast/events/page-visibility-iframe-move-test-expected.txt (87801 => 87802)
--- trunk/LayoutTests/fast/events/page-visibility-iframe-move-test-expected.txt 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/LayoutTests/fast/events/page-visibility-iframe-move-test-expected.txt 2011-06-01 14:11:23 UTC (rev 87802)
@@ -5,16 +5,16 @@
Window 1 Loaded
Window 2 Loaded
-PASS window.document.webkitIsVisible is true
-PASS window2.document.webkitIsVisible is true
-PASS iframe.contentDocument.webkitIsVisible is true
-PASS window.document.webkitIsVisible is false
-PASS window2.document.webkitIsVisible is true
-PASS iframe.contentDocument.webkitIsVisible is true
+PASS window.document.webkitHidden is false
+PASS window2.document.webkitHidden is false
+PASS iframe.contentDocument.webkitHidden is false
+PASS window.document.webkitHidden is true
+PASS window2.document.webkitHidden is false
+PASS iframe.contentDocument.webkitHidden is false
Adopted iframe to Window 1
-PASS window.document.webkitIsVisible is false
-PASS window2.document.webkitIsVisible is true
-PASS iframe.contentDocument.webkitIsVisible is false
+PASS window.document.webkitHidden is true
+PASS window2.document.webkitHidden is false
+PASS iframe.contentDocument.webkitHidden is true
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/events/page-visibility-iframe-move-test.html (87801 => 87802)
--- trunk/LayoutTests/fast/events/page-visibility-iframe-move-test.html 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/LayoutTests/fast/events/page-visibility-iframe-move-test.html 2011-06-01 14:11:23 UTC (rev 87802)
@@ -20,9 +20,9 @@
iframe = window2.document.getElementById("iframe");
- shouldBeTrue("window.document.webkitIsVisible");
- shouldBeTrue("window2.document.webkitIsVisible");
- shouldBeTrue("iframe.contentDocument.webkitIsVisible");
+ shouldBeFalse("window.document.webkitHidden");
+ shouldBeFalse("window2.document.webkitHidden");
+ shouldBeFalse("iframe.contentDocument.webkitHidden");
// Change the visibility of the current page to invisible.
if (window.layoutTestController) {
@@ -32,17 +32,17 @@
}
function onVisibilityChange() {
- shouldBeFalse("window.document.webkitIsVisible");
- shouldBeTrue("window2.document.webkitIsVisible");
- shouldBeTrue("iframe.contentDocument.webkitIsVisible");
+ shouldBeTrue("window.document.webkitHidden");
+ shouldBeFalse("window2.document.webkitHidden");
+ shouldBeFalse("iframe.contentDocument.webkitHidden");
window.document.adoptNode(iframe);
window.document.body.appendChild(iframe);
debug("Adopted iframe to Window 1");
- shouldBeFalse("window.document.webkitIsVisible");
- shouldBeTrue("window2.document.webkitIsVisible");
- shouldBeFalse("iframe.contentDocument.webkitIsVisible");
+ shouldBeTrue("window.document.webkitHidden");
+ shouldBeFalse("window2.document.webkitHidden");
+ shouldBeTrue("iframe.contentDocument.webkitHidden");
window2.close();
@@ -56,7 +56,7 @@
}
debug("Window 1 Loaded");
- document.addEventListener("webkitvisibilitystatechange",
+ document.addEventListener("webkitvisibilitychange",
onVisibilityChange, false);
window2 = window.open("resources/page-visibility-iframe-move-new-page.html");
Modified: trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test-expected.txt (87801 => 87802)
--- trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test-expected.txt 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test-expected.txt 2011-06-01 14:11:23 UTC (rev 87802)
@@ -5,22 +5,22 @@
Main Page:
PASS document.webkitVisibilityState is "visible"
-PASS document.webkitIsVisible is true
+PASS document.webkitHidden is false
Child Frame:
PASS childFrame.contentDocument.webkitVisibilityState is "visible"
-PASS childFrame.contentDocument.webkitIsVisible is true
+PASS childFrame.contentDocument.webkitHidden is false
Main Page:
PASS document.webkitVisibilityState is "hidden"
-PASS document.webkitIsVisible is false
+PASS document.webkitHidden is true
Child Frame:
PASS childFrame.contentDocument.webkitVisibilityState is "hidden"
-PASS childFrame.contentDocument.webkitIsVisible is false
+PASS childFrame.contentDocument.webkitHidden is true
Main Page:
PASS document.webkitVisibilityState is "visible"
-PASS document.webkitIsVisible is true
+PASS document.webkitHidden is false
Child Frame:
PASS childFrame.contentDocument.webkitVisibilityState is "visible"
-PASS childFrame.contentDocument.webkitIsVisible is true
+PASS childFrame.contentDocument.webkitHidden is false
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test.html (87801 => 87802)
--- trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test.html 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test.html 2011-06-01 14:11:23 UTC (rev 87802)
@@ -25,27 +25,27 @@
function checkIsPageVisible() {
debug("Main Page:");
shouldBeEqualToString("document.webkitVisibilityState", "visible");
- shouldBeTrue("document.webkitIsVisible");
+ shouldBeFalse("document.webkitHidden");
}
function checkIsPageHidden() {
debug("Main Page:");
shouldBeEqualToString("document.webkitVisibilityState", "hidden");
- shouldBeFalse("document.webkitIsVisible");
+ shouldBeTrue("document.webkitHidden");
}
function checkIsChildFrameVisible() {
debug("Child Frame:");
shouldBeEqualToString("childFrame.contentDocument.webkitVisibilityState",
"visible");
- shouldBeTrue("childFrame.contentDocument.webkitIsVisible");
+ shouldBeFalse("childFrame.contentDocument.webkitHidden");
}
function checkIsChildFrameHidden() {
debug("Child Frame:");
shouldBeEqualToString("childFrame.contentDocument.webkitVisibilityState",
"hidden");
- shouldBeFalse("childFrame.contentDocument.webkitIsVisible");
+ shouldBeTrue("childFrame.contentDocument.webkitHidden");
}
// We will try to change the visibility states as:
@@ -59,8 +59,8 @@
function startTest() {
childFrame = document.getElementById("childFrame");
childFrame.contentDocument.addEventListener(
- "webkitvisibilitystatechange", onChildFrameVisibilityChange, false);
- document.addEventListener("webkitvisibilitystatechange",
+ "webkitvisibilitychange", onChildFrameVisibilityChange, false);
+ document.addEventListener("webkitvisibilitychange",
onVisibilityChange, false);
checkIsPageVisible();
Modified: trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt (87801 => 87802)
--- trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt 2011-06-01 14:11:23 UTC (rev 87802)
@@ -4,13 +4,13 @@
PASS document.webkitVisibilityState is "visible"
-PASS document.webkitIsVisible is true
+PASS document.webkitHidden is false
PASS document.webkitVisibilityState is "hidden"
-PASS document.webkitIsVisible is false
+PASS document.webkitHidden is true
PASS document.webkitVisibilityState is "hidden"
-PASS document.webkitIsVisible is false
+PASS document.webkitHidden is true
PASS document.webkitVisibilityState is "visible"
-PASS document.webkitIsVisible is true
+PASS document.webkitHidden is false
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/events/page-visibility-transition-test.html (87801 => 87802)
--- trunk/LayoutTests/fast/events/page-visibility-transition-test.html 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/LayoutTests/fast/events/page-visibility-transition-test.html 2011-06-01 14:11:23 UTC (rev 87802)
@@ -24,12 +24,12 @@
function checkIsPageVisible() {
shouldBeEqualToString("document.webkitVisibilityState", "visible");
- shouldBeTrue("document.webkitIsVisible");
+ shouldBeFalse("document.webkitHidden");
}
function checkIsPageHidden() {
shouldBeEqualToString("document.webkitVisibilityState", "hidden");
- shouldBeFalse("document.webkitIsVisible");
+ shouldBeTrue("document.webkitHidden");
}
// We will try to change the visibility states as:
@@ -41,7 +41,7 @@
function startTest() {
document.addEventListener(
- "webkitvisibilitystatechange", onVisibilityChange, false);
+ "webkitvisibilitychange", onVisibilityChange, false);
checkIsPageVisible();
numVisibilityChanges++;
makePageHidden();
Modified: trunk/Source/WebCore/ChangeLog (87801 => 87802)
--- trunk/Source/WebCore/ChangeLog 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/Source/WebCore/ChangeLog 2011-06-01 14:11:23 UTC (rev 87802)
@@ -1,3 +1,23 @@
+2011-06-01 Shishir Agrawal <[email protected]>
+
+ Reviewed by Tony Gentilcore.
+
+ Renaming the Page Visibility attributes as per the modified spec draft.
+ https://bugs.webkit.org/show_bug.cgi?id=61825
+
+ Spec draft:
+ http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html
+
+ - Event needs to be webkitVisibilityChange from webkitVisibilityStateChange
+ - The attribute webkitIsVisible needs to change to webkitHidden
+
+ * dom/Document.cpp:
+ (WebCore::Document::webkitHidden):
+ (WebCore::Document::dispatchVisibilityStateChangeEvent):
+ * dom/Document.h:
+ * dom/Document.idl:
+ * dom/EventNames.h:
+
2011-06-01 Nikolas Zimmermann <[email protected]>
Reviewed by Rob Buis.
Modified: trunk/Source/WebCore/dom/Document.cpp (87801 => 87802)
--- trunk/Source/WebCore/dom/Document.cpp 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/Source/WebCore/dom/Document.cpp 2011-06-01 14:11:23 UTC (rev 87802)
@@ -1375,14 +1375,14 @@
return pageVisibilityStateString(visibilityState());
}
-bool Document::webkitIsVisible() const
+bool Document::webkitHidden() const
{
- return visibilityState() == PageVisibilityStateVisible;
+ return visibilityState() != PageVisibilityStateVisible;
}
void Document::dispatchVisibilityStateChangeEvent()
{
- dispatchEvent(Event::create(eventNames().webkitvisibilitystatechangeEvent, false, false));
+ dispatchEvent(Event::create(eventNames().webkitvisibilitychangeEvent, false, false));
}
#endif
Modified: trunk/Source/WebCore/dom/Document.h (87801 => 87802)
--- trunk/Source/WebCore/dom/Document.h 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/Source/WebCore/dom/Document.h 2011-06-01 14:11:23 UTC (rev 87802)
@@ -309,7 +309,7 @@
DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenchange);
#endif
#if ENABLE(PAGE_VISIBILITY_API)
- DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitvisibilitystatechange);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitvisibilitychange);
#endif
ViewportArguments viewportArguments() const { return m_viewportArguments; }
@@ -388,7 +388,7 @@
#if ENABLE(PAGE_VISIBILITY_API)
String webkitVisibilityState() const;
- bool webkitIsVisible() const;
+ bool webkitHidden() const;
void dispatchVisibilityStateChangeEvent();
#endif
Modified: trunk/Source/WebCore/dom/Document.idl (87801 => 87802)
--- trunk/Source/WebCore/dom/Document.idl 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/Source/WebCore/dom/Document.idl 2011-06-01 14:11:23 UTC (rev 87802)
@@ -339,7 +339,7 @@
// Page visibility API.
readonly attribute [Conditional=PAGE_VISIBILITY_API] DOMString webkitVisibilityState;
- readonly attribute [Conditional=PAGE_VISIBILITY_API] boolean webkitIsVisible;
+ readonly attribute [Conditional=PAGE_VISIBILITY_API] boolean webkitHidden;
};
Modified: trunk/Source/WebCore/dom/EventNames.h (87801 => 87802)
--- trunk/Source/WebCore/dom/EventNames.h 2011-06-01 14:10:15 UTC (rev 87801)
+++ trunk/Source/WebCore/dom/EventNames.h 2011-06-01 14:11:23 UTC (rev 87802)
@@ -106,7 +106,7 @@
macro(unload) \
macro(updateready) \
macro(versionchange) \
- macro(webkitvisibilitystatechange) \
+ macro(webkitvisibilitychange) \
macro(write) \
macro(writeend) \
macro(writestart) \