Changeset 85811 in webkit


Ignore:
Timestamp:
May 4, 2011 5:07:33 PM (13 years ago)
Author:
jer.noble@apple.com
Message:

2011-05-03 Jer Noble <jer.noble@apple.com>

Reviewed by Antti Koivisto.

Safari: Video at apple.com cannot play at full screen mode with layout distortion
https://bugs.webkit.org/show_bug.cgi?id=60140

  • fullscreen/full-screen-stacking-context-expected.txt: Added.
  • fullscreen/full-screen-stacking-context.html: Added.
  • platform/mac/fullscreen/full-screen-stacking-context-expected.png: Added.

2011-05-03 Jer Noble <jer.noble@apple.com>

Reviewed by Antti Koivisto.

Safari: Video at apple.com cannot play at full screen mode with layout distortion
https://bugs.webkit.org/show_bug.cgi?id=60140

Because a fullscreen element may be in a stacking context with a lower z-index than
a sibling stacking context, those higher contexts would sometimes "pop" through the
full screen renderer. To facilitate eliminating all the stacking contexts aside from
the full screen renderer, added a new pseudo-class specific to video or audio full
screen elements. Then, added a new UA rule which resets the z-index and opacities of
all elements under said pseudo-class to auto and 1 respectively. To facilitate quick
identity checking of HTMLMediaElements, added isMediaElement() virtual function to
Element and HTMLMediaElement.

Test: fullscreen/full-screen-stacking-context.html

  • css/CSSSelector.cpp: (WebCore::CSSSelector::pseudoId): Support PseudoFullScreenMediaDocument. (WebCore::nameToPseudoTypeMap): Support fullScreenMediaDocument. (WebCore::CSSSelector::extractPseudoType): Support PseudoFullScreenMediaDocument.
  • css/CSSSelector.h: Add PseudoFullScreenMediaDocument.
  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Support PseudoFullScreenMediaDocument.
  • css/fullscreen.css: (:root:-webkit-full-screen-document:not(:-webkit-full-screen)): Corrected these names,

which were missing the -webkit prefix.

(:root:-webkit-full-screen-media-document *:not(-webkit-full-screen)): Added.

  • dom/Element.h: (WebCore::Element::isMediaElement): Added, returns false.
  • html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::isMediaElement): Added, returns true.
  • rendering/style/RenderStyleConstants.h: Added FULL_SCREEN_MEDIA_DOCUMENT.
Location:
trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85809 r85811  
     12011-05-03  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Safari: Video at apple.com cannot play at full screen mode with layout distortion
     6        https://bugs.webkit.org/show_bug.cgi?id=60140
     7
     8        * fullscreen/full-screen-stacking-context-expected.txt: Added.
     9        * fullscreen/full-screen-stacking-context.html: Added.
     10        * platform/mac/fullscreen/full-screen-stacking-context-expected.png: Added.
     11
    1122011-05-04  Ojan Vafai  <ojan@chromium.org>
    213
  • trunk/Source/WebCore/ChangeLog

    r85810 r85811  
     12011-05-03  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Safari: Video at apple.com cannot play at full screen mode with layout distortion
     6        https://bugs.webkit.org/show_bug.cgi?id=60140
     7
     8        Because a fullscreen element may be in a stacking context with a lower z-index than
     9        a sibling stacking context, those higher contexts would sometimes "pop" through the
     10        full screen renderer. To facilitate eliminating all the stacking contexts aside from
     11        the full screen renderer, added a new pseudo-class specific to video or audio full
     12        screen elements. Then, added a new UA rule which resets the z-index and opacities of
     13        all elements under said pseudo-class to auto and 1 respectively. To facilitate quick
     14        identity checking of HTMLMediaElements, added isMediaElement() virtual function to
     15        Element and HTMLMediaElement.
     16
     17        Test: fullscreen/full-screen-stacking-context.html
     18
     19        * css/CSSSelector.cpp:
     20        (WebCore::CSSSelector::pseudoId): Support PseudoFullScreenMediaDocument.
     21        (WebCore::nameToPseudoTypeMap): Support fullScreenMediaDocument.
     22        (WebCore::CSSSelector::extractPseudoType): Support PseudoFullScreenMediaDocument.
     23        * css/CSSSelector.h: Add PseudoFullScreenMediaDocument.
     24        * css/CSSStyleSelector.cpp:
     25        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Support PseudoFullScreenMediaDocument.
     26        * css/fullscreen.css:
     27        (:root:-webkit-full-screen-document:not(:-webkit-full-screen)): Corrected these names,
     28            which were missing the -webkit prefix.
     29        (:root:-webkit-full-screen-media-document *:not(-webkit-full-screen)): Added.
     30        * dom/Element.h:
     31        (WebCore::Element::isMediaElement): Added, returns false.
     32        * html/HTMLMediaElement.h:
     33        (WebCore::HTMLMediaElement::isMediaElement): Added, returns true.
     34        * rendering/style/RenderStyleConstants.h: Added FULL_SCREEN_MEDIA_DOCUMENT.
     35
    1362011-05-04  Levi Weintraub  <leviw@chromium.org>
    237
  • trunk/Source/WebCore/css/CSSSelector.cpp

    r82904 r85811  
    166166    case PseudoFullScreenDocument:
    167167        return FULL_SCREEN_DOCUMENT;
     168    case PseudoFullScreenMediaDocument:
     169        return FULL_SCREEN_MEDIA_DOCUMENT;
    168170#endif
    169171           
     
    320322    DEFINE_STATIC_LOCAL(AtomicString, fullScreen, ("-webkit-full-screen"));
    321323    DEFINE_STATIC_LOCAL(AtomicString, fullScreenDocument, ("-webkit-full-screen-document"));
     324    DEFINE_STATIC_LOCAL(AtomicString, fullScreenMediaDocument, ("-webkit-full-screen-media-document"));
    322325#endif
    323326    DEFINE_STATIC_LOCAL(AtomicString, inRange, ("in-range"));
     
    407410        nameToPseudoType->set(fullScreen.impl(), CSSSelector::PseudoFullScreen);
    408411        nameToPseudoType->set(fullScreenDocument.impl(), CSSSelector::PseudoFullScreenDocument);
     412        nameToPseudoType->set(fullScreenMediaDocument.impl(), CSSSelector::PseudoFullScreenMediaDocument);
    409413#endif
    410414        nameToPseudoType->set(inRange.impl(), CSSSelector::PseudoInRange);
     
    516520    case PseudoFullScreen:
    517521    case PseudoFullScreenDocument:
     522    case PseudoFullScreenMediaDocument:
    518523#endif
    519524    case PseudoInRange:
  • trunk/Source/WebCore/css/CSSSelector.h

    r85728 r85811  
    190190            PseudoFullScreen,
    191191            PseudoFullScreenDocument,
     192            PseudoFullScreenMediaDocument,
    192193#endif
    193194            PseudoInRange,
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r85788 r85811  
    29052905                    return false;
    29062906                if (e != e->document()->webkitCurrentFullScreenElement())
     2907                    return false;
     2908                return true;
     2909            case CSSSelector::PseudoFullScreenMediaDocument:
     2910                if (!e->document()->webkitIsFullScreen())
     2911                    return false;
     2912                if (!e->document()->webkitCurrentFullScreenElement() || !e->document()->webkitCurrentFullScreenElement()->isMediaElement())
    29072913                    return false;
    29082914                return true;
  • trunk/Source/WebCore/css/fullscreen.css

    r85719 r85811  
    33}
    44
    5 :root:full-screen-document:not(:full-screen) {
     5:root:-webkit-full-screen-document:not(:-webkit-full-screen) {
    66    overflow:hidden;
     7}
     8
     9:root:-webkit-full-screen-media-document *:not(:-webkit-full-screen) {
     10    z-index: auto !important;
     11    opacity: 1 !important;
     12    -webkit-tranform: none !important;
    713}
    814
  • trunk/Source/WebCore/dom/Element.h

    r85644 r85811  
    304304#endif
    305305
     306#if ENABLE(VIDEO)
     307    virtual bool isMediaElement() const { return false; }
     308#endif
     309
    306310#if ENABLE(INPUT_SPEECH)
    307311    virtual bool isInputFieldSpeechButtonElement() const { return false; }
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r85518 r85811  
    216216    DisplayMode displayMode() const { return m_displayMode; }
    217217    virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; }
     218   
     219    virtual bool isMediaElement() const { return true; }
    218220
    219221private:
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r84380 r85811  
    7575    METER_BAR, METER_OPTIMUM, METER_SUBOPTIMAL, METER_EVEN_LESS_GOOD,
    7676    AFTER_LAST_INTERNAL_PSEUDOID,
    77     FULL_SCREEN, FULL_SCREEN_DOCUMENT,
     77    FULL_SCREEN, FULL_SCREEN_DOCUMENT, FULL_SCREEN_MEDIA_DOCUMENT,
    7878    FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
    7979    FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON,
Note: See TracChangeset for help on using the changeset viewer.