Changeset 87802 in webkit


Ignore:
Timestamp:
Jun 1, 2011 7:11:23 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-01 Shishir Agrawal <shishir@chromium.org>

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 Shishir Agrawal <shishir@chromium.org>

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:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r87800 r87802  
     12011-06-01  Shishir Agrawal  <shishir@chromium.org>
     2
     3        Reviewed by Tony Gentilcore.
     4
     5        Renaming the Page Visibility attributes as per the modified spec draft.
     6        https://bugs.webkit.org/show_bug.cgi?id=61825
     7
     8        Spec draft:
     9        http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html
     10
     11        - Event needs to be webkitVisibilityChange from webkitVisibilityStateChange
     12        - The attribute webkitIsVisible needs to change to webkitHidden
     13
     14        * fast/events/page-visibility-iframe-delete-test.html:
     15        * fast/events/page-visibility-iframe-move-test-expected.txt:
     16        * fast/events/page-visibility-iframe-move-test.html:
     17        * fast/events/page-visibility-iframe-propagation-test-expected.txt:
     18        * fast/events/page-visibility-iframe-propagation-test.html:
     19        * fast/events/page-visibility-transition-test-expected.txt:
     20        * fast/events/page-visibility-transition-test.html:
     21
    1222011-06-01  Gabor Loki  <loki@webkit.org>
    223
  • trunk/LayoutTests/fast/events/page-visibility-iframe-delete-test.html

    r86047 r87802  
    3636
    3737    document.addEventListener(
    38         "webkitvisibilitystatechange", onMainPageVisibilityChange, false);
     38        "webkitvisibilitychange", onMainPageVisibilityChange, false);
    3939    frame2.contentDocument.addEventListener(
    40         "webkitvisibilitystatechange", onFrame2VisibilityChange, false);
     40        "webkitvisibilitychange", onFrame2VisibilityChange, false);
    4141    // Change the visibility of the current page to invisible.
    4242    if (window.layoutTestController) {
  • trunk/LayoutTests/fast/events/page-visibility-iframe-move-test-expected.txt

    r86047 r87802  
    66Window 1 Loaded
    77Window 2 Loaded
    8 PASS window.document.webkitIsVisible is true
    9 PASS window2.document.webkitIsVisible is true
    10 PASS iframe.contentDocument.webkitIsVisible is true
    11 PASS window.document.webkitIsVisible is false
    12 PASS window2.document.webkitIsVisible is true
    13 PASS iframe.contentDocument.webkitIsVisible is true
     8PASS window.document.webkitHidden is false
     9PASS window2.document.webkitHidden is false
     10PASS iframe.contentDocument.webkitHidden is false
     11PASS window.document.webkitHidden is true
     12PASS window2.document.webkitHidden is false
     13PASS iframe.contentDocument.webkitHidden is false
    1414Adopted iframe to Window 1
    15 PASS window.document.webkitIsVisible is false
    16 PASS window2.document.webkitIsVisible is true
    17 PASS iframe.contentDocument.webkitIsVisible is false
     15PASS window.document.webkitHidden is true
     16PASS window2.document.webkitHidden is false
     17PASS iframe.contentDocument.webkitHidden is true
    1818PASS successfullyParsed is true
    1919
  • trunk/LayoutTests/fast/events/page-visibility-iframe-move-test.html

    r86047 r87802  
    2121    iframe = window2.document.getElementById("iframe");
    2222
    23     shouldBeTrue("window.document.webkitIsVisible");
    24     shouldBeTrue("window2.document.webkitIsVisible");
    25     shouldBeTrue("iframe.contentDocument.webkitIsVisible");
     23    shouldBeFalse("window.document.webkitHidden");
     24    shouldBeFalse("window2.document.webkitHidden");
     25    shouldBeFalse("iframe.contentDocument.webkitHidden");
    2626
    2727    // Change the visibility of the current page to invisible.
     
    3333
    3434function onVisibilityChange() {
    35     shouldBeFalse("window.document.webkitIsVisible");
    36     shouldBeTrue("window2.document.webkitIsVisible");
    37     shouldBeTrue("iframe.contentDocument.webkitIsVisible");
     35    shouldBeTrue("window.document.webkitHidden");
     36    shouldBeFalse("window2.document.webkitHidden");
     37    shouldBeFalse("iframe.contentDocument.webkitHidden");
    3838
    3939    window.document.adoptNode(iframe);
     
    4141    debug("Adopted iframe to Window 1");
    4242
    43     shouldBeFalse("window.document.webkitIsVisible");
    44     shouldBeTrue("window2.document.webkitIsVisible");
    45     shouldBeFalse("iframe.contentDocument.webkitIsVisible");
     43    shouldBeTrue("window.document.webkitHidden");
     44    shouldBeFalse("window2.document.webkitHidden");
     45    shouldBeTrue("iframe.contentDocument.webkitHidden");
    4646
    4747    window2.close();
     
    5757
    5858    debug("Window 1 Loaded");
    59     document.addEventListener("webkitvisibilitystatechange",
     59    document.addEventListener("webkitvisibilitychange",
    6060                              onVisibilityChange, false);
    6161
  • trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test-expected.txt

    r86047 r87802  
    66Main Page:
    77PASS document.webkitVisibilityState is "visible"
    8 PASS document.webkitIsVisible is true
     8PASS document.webkitHidden is false
    99Child Frame:
    1010PASS childFrame.contentDocument.webkitVisibilityState is "visible"
    11 PASS childFrame.contentDocument.webkitIsVisible is true
     11PASS childFrame.contentDocument.webkitHidden is false
    1212Main Page:
    1313PASS document.webkitVisibilityState is "hidden"
    14 PASS document.webkitIsVisible is false
     14PASS document.webkitHidden is true
    1515Child Frame:
    1616PASS childFrame.contentDocument.webkitVisibilityState is "hidden"
    17 PASS childFrame.contentDocument.webkitIsVisible is false
     17PASS childFrame.contentDocument.webkitHidden is true
    1818Main Page:
    1919PASS document.webkitVisibilityState is "visible"
    20 PASS document.webkitIsVisible is true
     20PASS document.webkitHidden is false
    2121Child Frame:
    2222PASS childFrame.contentDocument.webkitVisibilityState is "visible"
    23 PASS childFrame.contentDocument.webkitIsVisible is true
     23PASS childFrame.contentDocument.webkitHidden is false
    2424PASS successfullyParsed is true
    2525
  • trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test.html

    r86047 r87802  
    2626    debug("Main Page:");
    2727    shouldBeEqualToString("document.webkitVisibilityState", "visible");
    28     shouldBeTrue("document.webkitIsVisible");
     28    shouldBeFalse("document.webkitHidden");
    2929}
    3030
     
    3232    debug("Main Page:");
    3333    shouldBeEqualToString("document.webkitVisibilityState", "hidden");
    34     shouldBeFalse("document.webkitIsVisible");
     34    shouldBeTrue("document.webkitHidden");
    3535}
    3636
     
    3939    shouldBeEqualToString("childFrame.contentDocument.webkitVisibilityState",
    4040                          "visible");
    41     shouldBeTrue("childFrame.contentDocument.webkitIsVisible");
     41    shouldBeFalse("childFrame.contentDocument.webkitHidden");
    4242}
    4343
     
    4646    shouldBeEqualToString("childFrame.contentDocument.webkitVisibilityState",
    4747                          "hidden");
    48     shouldBeFalse("childFrame.contentDocument.webkitIsVisible");
     48    shouldBeTrue("childFrame.contentDocument.webkitHidden");
    4949}
    5050
     
    6060    childFrame = document.getElementById("childFrame");
    6161    childFrame.contentDocument.addEventListener(
    62         "webkitvisibilitystatechange", onChildFrameVisibilityChange, false);
    63     document.addEventListener("webkitvisibilitystatechange",
     62        "webkitvisibilitychange", onChildFrameVisibilityChange, false);
     63    document.addEventListener("webkitvisibilitychange",
    6464                              onVisibilityChange, false);
    6565
  • trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt

    r86047 r87802  
    55
    66PASS document.webkitVisibilityState is "visible"
    7 PASS document.webkitIsVisible is true
     7PASS document.webkitHidden is false
    88PASS document.webkitVisibilityState is "hidden"
    9 PASS document.webkitIsVisible is false
     9PASS document.webkitHidden is true
    1010PASS document.webkitVisibilityState is "hidden"
    11 PASS document.webkitIsVisible is false
     11PASS document.webkitHidden is true
    1212PASS document.webkitVisibilityState is "visible"
    13 PASS document.webkitIsVisible is true
     13PASS document.webkitHidden is false
    1414PASS successfullyParsed is true
    1515
  • trunk/LayoutTests/fast/events/page-visibility-transition-test.html

    r86047 r87802  
    2525function checkIsPageVisible() {
    2626    shouldBeEqualToString("document.webkitVisibilityState", "visible");
    27     shouldBeTrue("document.webkitIsVisible");
     27    shouldBeFalse("document.webkitHidden");
    2828}
    2929
    3030function checkIsPageHidden() {
    3131    shouldBeEqualToString("document.webkitVisibilityState", "hidden");
    32     shouldBeFalse("document.webkitIsVisible");
     32    shouldBeTrue("document.webkitHidden");
    3333}
    3434
     
    4242function startTest() {
    4343    document.addEventListener(
    44         "webkitvisibilitystatechange", onVisibilityChange, false);
     44        "webkitvisibilitychange", onVisibilityChange, false);
    4545    checkIsPageVisible();
    4646    numVisibilityChanges++;
  • trunk/Source/WebCore/ChangeLog

    r87801 r87802  
     12011-06-01  Shishir Agrawal  <shishir@chromium.org>
     2
     3        Reviewed by Tony Gentilcore.
     4
     5        Renaming the Page Visibility attributes as per the modified spec draft.
     6        https://bugs.webkit.org/show_bug.cgi?id=61825
     7
     8        Spec draft:
     9        http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html
     10
     11        - Event needs to be webkitVisibilityChange from webkitVisibilityStateChange
     12        - The attribute webkitIsVisible needs to change to webkitHidden
     13
     14        * dom/Document.cpp:
     15        (WebCore::Document::webkitHidden):
     16        (WebCore::Document::dispatchVisibilityStateChangeEvent):
     17        * dom/Document.h:
     18        * dom/Document.idl:
     19        * dom/EventNames.h:
     20
    1212011-06-01  Nikolas Zimmermann  <nzimmermann@rim.com>
    222
  • trunk/Source/WebCore/dom/Document.cpp

    r87756 r87802  
    13761376}
    13771377
    1378 bool Document::webkitIsVisible() const
    1379 {
    1380     return visibilityState() == PageVisibilityStateVisible;
     1378bool Document::webkitHidden() const
     1379{
     1380    return visibilityState() != PageVisibilityStateVisible;
    13811381}
    13821382
    13831383void Document::dispatchVisibilityStateChangeEvent()
    13841384{
    1385     dispatchEvent(Event::create(eventNames().webkitvisibilitystatechangeEvent, false, false));
     1385    dispatchEvent(Event::create(eventNames().webkitvisibilitychangeEvent, false, false));
    13861386}
    13871387#endif
  • trunk/Source/WebCore/dom/Document.h

    r87756 r87802  
    310310#endif
    311311#if ENABLE(PAGE_VISIBILITY_API)
    312     DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitvisibilitystatechange);
     312    DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitvisibilitychange);
    313313#endif
    314314
     
    389389#if ENABLE(PAGE_VISIBILITY_API)
    390390    String webkitVisibilityState() const;
    391     bool webkitIsVisible() const;
     391    bool webkitHidden() const;
    392392    void dispatchVisibilityStateChangeEvent();
    393393#endif
  • trunk/Source/WebCore/dom/Document.idl

    r86700 r87802  
    340340        // Page visibility API.
    341341        readonly attribute [Conditional=PAGE_VISIBILITY_API] DOMString webkitVisibilityState;
    342         readonly attribute [Conditional=PAGE_VISIBILITY_API] boolean webkitIsVisible;
     342        readonly attribute [Conditional=PAGE_VISIBILITY_API] boolean webkitHidden;
    343343
    344344    };
  • trunk/Source/WebCore/dom/EventNames.h

    r86047 r87802  
    107107    macro(updateready) \
    108108    macro(versionchange) \
    109     macro(webkitvisibilitystatechange) \
     109    macro(webkitvisibilitychange) \
    110110    macro(write) \
    111111    macro(writeend) \
Note: See TracChangeset for help on using the changeset viewer.