Changeset 57924 in webkit


Ignore:
Timestamp:
Apr 20, 2010 3:04:59 PM (14 years ago)
Author:
kenneth@webkit.org
Message:

Rename window.media to window.styleMedia
https://bugs.webkit.org/show_bug.cgi?id=36187

Reviewed by Simon Fraser.

WebCore:

It has been defined that the AbstractView media extension
defined in the CSSOM View spec should be renamed to styleMedia.
This patch does that and updates the current layout tests
making use of it.

  • page/AbstractView.idl:
  • page/DOMWindow.cpp:

(WebCore::DOMWindow::styleMedia):

  • page/DOMWindow.h:
  • page/DOMWindow.idl:

LayoutTests:

Update layout tests.

  • fast/media/lifetime.html:
  • fast/media/matchmedium-query-api.html:
  • fast/media/print-restores-previous-mediatype.html:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r57922 r57924  
     12010-04-20  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Rename window.media to window.styleMedia
     6        https://bugs.webkit.org/show_bug.cgi?id=36187
     7
     8        Update layout tests.
     9
     10        * fast/media/lifetime.html:
     11        * fast/media/matchmedium-query-api.html:
     12        * fast/media/print-restores-previous-mediatype.html:
     13        * fast/media/print-restores-previous-mediatype-expected.txt:
     14
    1152010-04-20  Justin Schuh  <jschuh@chromium.org>
    216
  • trunk/LayoutTests/fast/media/lifetime.html

    r53555 r57924  
    2121function test()
    2222{
    23     if (!window.media) {
    24         document.getElementById("result").innerHTML = "FAIL - window.media is not supported.";
     23    if (!window.styleMedia) {
     24        document.getElementById("result").innerHTML = "FAIL - window.styleMedia is not supported.";
    2525        return;
    2626    }
    2727
    28     media.foo = "bar";
     28    styleMedia.foo = "bar";
    2929    gc();
    30     if (media.foo != "bar") {
    31         document.getElementById("result").innerHTML = "FAIL - Window.media doesn't return the same object each time.";
     30    if (styleMedia.foo != "bar") {
     31        document.getElementById("result").innerHTML = "FAIL - window.styelMedia doesn't return the same object each time.";
    3232        return;
    3333    }
    3434
    35     var m = frames[0].media;
     35    var m = frames[0].styleMedia;
    3636    document.body.removeChild(document.getElementsByTagName("iframe")[0]);
    3737    try { m.matchMedium("foobar") } catch (ex) { }
  • trunk/LayoutTests/fast/media/matchmedium-query-api.html

    r46874 r57924  
    1717  function testQuery(query, expected)
    1818  {
    19     var isTrue = document.defaultView.media.matchMedium(query);
     19    var isTrue = window.styleMedia.matchMedium(query);
    2020
    2121    var message = '\"' + query + '\" evaluates to ' + (isTrue ? 'true' : 'false');
  • trunk/LayoutTests/fast/media/print-restores-previous-mediatype-expected.txt

    r56209 r57924  
    11Media type is set to 'handheld' to be different than the default 'screen'
    2 PASS: window.media.type should be 'handheld' and is.
     2PASS: window.styleMedia.type should be 'handheld' and is.
    33
    44The page is printed, which changes the media type to 'print', and then back
    5 PASS: window.media.type should be 'handheld' and is.
     5PASS: window.styleMedia.type should be 'handheld' and is.
    66
  • trunk/LayoutTests/fast/media/print-restores-previous-mediatype.html

    r56209 r57924  
    2929    {
    3030        log("Media type is set to 'handheld' to be different than the default 'screen'");
    31         shouldBe("window.media.type", window.media.type, "handheld");
     31        shouldBe("window.styleMedia.type", window.styleMedia.type, "handheld");
    3232        log("<br>The page is printed, which changes the media type to 'print', and then back");
    3333        window.print();
    34         shouldBe("window.media.type", window.media.type, "handheld");
     34        shouldBe("window.styleMedia.type", window.styleMedia.type, "handheld");
    3535    }
    3636</script>
  • trunk/WebCore/ChangeLog

    r57923 r57924  
     12010-04-20  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Rename window.media to window.styleMedia
     6        https://bugs.webkit.org/show_bug.cgi?id=36187
     7
     8        It has been defined that the AbstractView media extension
     9        defined in the CSSOM View spec should be renamed to styleMedia.
     10        This patch does that and updates the current layout tests
     11        making use of it.
     12
     13        * page/AbstractView.idl:
     14        * page/DOMWindow.cpp:
     15        (WebCore::DOMWindow::styleMedia):
     16        * page/DOMWindow.h:
     17        * page/DOMWindow.idl:
     18
    1192010-04-20  Timothy Hatcher  <timothy@apple.com>
    220
  • trunk/WebCore/page/AbstractView.idl

    r52534 r57924  
    3333    ] AbstractView {
    3434        readonly attribute Document document;
    35         readonly attribute Media media;
     35        readonly attribute Media styleMedia;
    3636    };
    3737
  • trunk/WebCore/page/DOMWindow.cpp

    r57865 r57924  
    11371137}
    11381138
    1139 PassRefPtr<Media> DOMWindow::media() const
     1139PassRefPtr<Media> DOMWindow::styleMedia() const
    11401140{
    11411141    if (!m_media)
  • trunk/WebCore/page/DOMWindow.h

    r56777 r57924  
    188188        Document* document() const;
    189189        // CSSOM View Module
    190         PassRefPtr<Media> media() const;
     190        PassRefPtr<Media> styleMedia() const;
    191191
    192192        // DOM Level 2 Style Interface
  • trunk/WebCore/page/DOMWindow.idl

    r57205 r57924  
    142142
    143143        // CSSOM View Module
    144         readonly attribute Media media;
     144        readonly attribute Media styleMedia;
    145145
    146146        // DOM Level 2 Style Interface
Note: See TracChangeset for help on using the changeset viewer.