Changeset 143533 in webkit


Ignore:
Timestamp:
Feb 20, 2013 4:32:26 PM (11 years ago)
Author:
scheib@chromium.org
Message:

Accept 'allowfullscreen' in addition to 'webkitallowfullscreen'.
https://bugs.webkit.org/show_bug.cgi?id=110374

Reviewed by Adam Barth.

Source/WebCore:

The fullscreen API also includes a new HTML attribute for iframes
which permits its use. That attribute, 'allowfullcreen' is now
included in the HTML specification [1] and is stable enough
to remove the webkit prefix.

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-allowfullscreen

Tests: fullscreen/full-screen-enabled-prefixed.html

fullscreen/full-screen-iframe-allowed-prefixed.html
fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute.html

  • dom/Document.cpp:

(WebCore::isAttributeOnAllOwners):
(WebCore::Document::fullScreenIsAllowedForElement):
(WebCore::Document::webkitFullscreenEnabled):

  • html/HTMLAttributeNames.in:

LayoutTests:

Two previous tests duplicated to preserve testing webkitallowfullscreen
and then modified to test allowfullscreen.

A new test 'full-screen-iframe-with-mixed-allow-webkitallow-attribute.html'
added to test a mixed nesting of iframs with both allowfullscreen and
webkitallowfullscreen.

  • fullscreen/full-screen-enabled-prefixed-expected.txt: Added.
  • fullscreen/full-screen-enabled-prefixed.html: Copied from LayoutTests/fullscreen/full-screen-enabled.html.
  • fullscreen/full-screen-enabled.html:
  • fullscreen/full-screen-iframe-allowed-prefixed-expected.txt: Added.
  • fullscreen/full-screen-iframe-allowed-prefixed.html: Copied from LayoutTests/fullscreen/full-screen-iframe-allowed.html.
  • fullscreen/full-screen-iframe-allowed.html:
  • fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute-expected.txt:
  • fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute.html: Added.
  • fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe1.html: Added.
  • fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe2.html: Added.
Location:
trunk
Files:
6 added
6 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143520 r143533  
     12013-02-20  Vincent Scheib  <scheib@chromium.org>
     2
     3        Accept 'allowfullscreen' in addition to 'webkitallowfullscreen'.
     4        https://bugs.webkit.org/show_bug.cgi?id=110374
     5
     6        Reviewed by Adam Barth.
     7
     8        Two previous tests duplicated to preserve testing webkitallowfullscreen
     9        and then modified to test allowfullscreen.
     10
     11        A new test 'full-screen-iframe-with-mixed-allow-webkitallow-attribute.html'
     12        added to test a mixed nesting of iframs with both allowfullscreen and
     13        webkitallowfullscreen.
     14
     15        * fullscreen/full-screen-enabled-prefixed-expected.txt: Added.
     16        * fullscreen/full-screen-enabled-prefixed.html: Copied from LayoutTests/fullscreen/full-screen-enabled.html.
     17        * fullscreen/full-screen-enabled.html:
     18        * fullscreen/full-screen-iframe-allowed-prefixed-expected.txt: Added.
     19        * fullscreen/full-screen-iframe-allowed-prefixed.html: Copied from LayoutTests/fullscreen/full-screen-iframe-allowed.html.
     20        * fullscreen/full-screen-iframe-allowed.html:
     21        * fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute-expected.txt:
     22        * fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute.html: Added.
     23        * fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe1.html: Added.
     24        * fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe2.html: Added.
     25
    1262013-02-20  Levi Weintraub  <leviw@chromium.org>
    227
  • trunk/LayoutTests/fullscreen/full-screen-enabled.html

    r111028 r143533  
    55<script>
    66    var iframe = document.documentElement.appendChild(document.createElement('iframe'));
    7     iframe.setAttribute('webkitallowfullscreen', 'true');
     7    iframe.setAttribute('allowfullscreen', 'true');
    88    var iframe2 = document.documentElement.appendChild(document.createElement('iframe'));
    99    testExpected('iframe.contentDocument.webkitFullscreenEnabled', true);
  • trunk/LayoutTests/fullscreen/full-screen-iframe-allowed.html

    r84706 r143533  
    2323}
    2424</script>
    25 <iframe id="frame" src="resources/inner.html" width="300" height="100" onload="runTest()" webkitallowfullscreen>
     25<iframe id="frame" src="resources/inner.html" width="300" height="100" onload="runTest()" allowfullscreen>
    2626</iframe>
  • trunk/Source/WebCore/ChangeLog

    r143529 r143533  
     12013-02-20  Vincent Scheib  <scheib@chromium.org>
     2
     3        Accept 'allowfullscreen' in addition to 'webkitallowfullscreen'.
     4        https://bugs.webkit.org/show_bug.cgi?id=110374
     5
     6        Reviewed by Adam Barth.
     7
     8        The fullscreen API also includes a new HTML attribute for iframes
     9        which permits its use. That attribute, 'allowfullcreen' is now
     10        included in the HTML specification [1] and is stable enough
     11        to remove the webkit prefix.
     12
     13        [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-allowfullscreen
     14
     15        Tests: fullscreen/full-screen-enabled-prefixed.html
     16               fullscreen/full-screen-iframe-allowed-prefixed.html
     17               fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute.html
     18
     19        * dom/Document.cpp:
     20        (WebCore::isAttributeOnAllOwners):
     21        (WebCore::Document::fullScreenIsAllowedForElement):
     22        (WebCore::Document::webkitFullscreenEnabled):
     23        * html/HTMLAttributeNames.in:
     24
    1252013-02-20  Roger Fong  <roger_fong@apple.com>
    226
  • trunk/Source/WebCore/dom/Document.cpp

    r143428 r143533  
    563563
    564564#if ENABLE(FULLSCREEN_API)
    565 static bool isAttributeOnAllOwners(const WebCore::QualifiedName& attribute, const HTMLFrameOwnerElement* owner)
     565static bool isAttributeOnAllOwners(const WebCore::QualifiedName& attribute, const WebCore::QualifiedName& prefixedAttribute, const HTMLFrameOwnerElement* owner)
    566566{
    567567    if (!owner)
    568568        return true;
    569569    do {
    570         if (!owner->hasAttribute(attribute))
     570        if (!(owner->hasAttribute(attribute) || owner->hasAttribute(prefixedAttribute)))
    571571            return false;
    572572    } while ((owner = owner->document()->ownerElement()));
     
    49534953{
    49544954    ASSERT(element);
    4955     return isAttributeOnAllOwners(webkitallowfullscreenAttr, element->document()->ownerElement());
     4955    return isAttributeOnAllOwners(allowfullscreenAttr, webkitallowfullscreenAttr, element->document()->ownerElement());
    49564956}
    49574957
     
    51725172
    51735173    // Top-level browsing contexts are implied to have their allowFullScreen attribute set.
    5174     return isAttributeOnAllOwners(webkitallowfullscreenAttr, ownerElement());
     5174    return isAttributeOnAllOwners(allowfullscreenAttr, webkitallowfullscreenAttr, ownerElement());
    51755175}
    51765176
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r140010 r143533  
    1111align
    1212alink
     13allowfullscreen
    1314alt
    1415archive
Note: See TracChangeset for help on using the changeset viewer.