Changeset 122816 in webkit
- Timestamp:
- Jul 17, 2012 12:26:52 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r122815 r122816 1 2012-07-17 Shinya Kawanaka <shinyak@chromium.org> 2 3 HTMLMediaElement should not use Element::ensureShadowRoot() 4 https://bugs.webkit.org/show_bug.cgi?id=77936 5 6 Reviewed by Hajime Morita. 7 8 Adding Shadow DOM to a video element and an audio element is allowed now. 9 10 * fast/dom/shadow/shadow-disable-expected.txt: 11 * fast/dom/shadow/shadow-disable.html: 12 * fast/dom/shadow/shadowdom-for-media-expected.txt: Added. 13 * fast/dom/shadow/shadowdom-for-media.html: Added. 14 1 15 2012-07-17 Yoshifumi Inoue <yosin@chromium.org> 2 16 -
trunk/LayoutTests/fast/dom/shadow/shadow-disable-expected.txt
r107202 r122816 12 12 SECTION 13 13 PASS new WebKitShadowRoot(element) is not null 14 AUDIO 15 PASS new WebKitShadowRoot(element) is not null 16 VIDEO 17 PASS new WebKitShadowRoot(element) is not null 14 18 INPUT 15 19 PASS new WebKitShadowRoot(element) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3. … … 17 21 PASS new WebKitShadowRoot(element) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3. 18 22 SELECT 19 PASS new WebKitShadowRoot(element) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3.20 AUDIO21 PASS new WebKitShadowRoot(element) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3.22 VIDEO23 23 PASS new WebKitShadowRoot(element) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3. 24 24 tref -
trunk/LayoutTests/fast/dom/shadow/shadow-disable.html
r107202 r122816 24 24 document.createElement('span'), 25 25 document.createElement('a'), 26 document.createElement('section') 26 document.createElement('section'), 27 document.createElement('audio'), 28 document.createElement('video') 27 29 ]; 28 30 … … 31 33 document.createElement('textarea'), 32 34 document.createElement('select'), 33 document.createElement('audio'),34 document.createElement('video'),35 35 document.getElementById('tref') 36 36 ]; -
trunk/Source/WebCore/ChangeLog
r122812 r122816 1 2012-07-17 Shinya Kawanaka <shinyak@chromium.org> 2 3 HTMLMediaElement should not use Element::ensureShadowRoot() 4 https://bugs.webkit.org/show_bug.cgi?id=77936 5 6 Reviewed by Hajime Morita. 7 8 a video element and an audio element add UserAgentShadowRoot dynamically, and they assume that it's the oldest ShadowRoot. 9 However an AuthorShadowRoot could be added by a user before a video element and an audio element add UserAgentShadowRoot. 10 It breaks the assumption that the UserAgentShadowRoot is the oldest. 11 12 If the UserAgentShadowRoot is not the oldest, the AuthorShadowRoot a page author added might be ignored. 13 Since the timing to add UserAgentShadowRoot is not known by a user, the fact that UserAgentShadorRoot is 14 not the oldest will cause inconsistent behavior. 15 16 Adding AuthorShadowRoot to a video element and an audio element is allowed by this patch. 17 18 Test: fast/dom/shadow/shadowdom-for-media.html 19 20 * dom/ShadowRoot.cpp: 21 (WebCore::allowsAuthorShadowRoot): 22 * html/HTMLMediaElement.cpp: 23 (WebCore::HTMLMediaElement::createShadowSubtree): 24 (WebCore): 25 (WebCore::HTMLMediaElement::willAddAuthorShadowRoot): 26 (WebCore::HTMLMediaElement::createMediaControls): 27 * html/HTMLMediaElement.h: 28 (HTMLMediaElement): 29 1 30 2012-07-16 Daniel Bates <dbates@webkit.org> 2 31 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r122530 r122816 76 76 static bool allowsAuthorShadowRoot(Element* element) 77 77 { 78 // FIXME: MEDIA recreates shadow root dynamically.79 // https://bugs.webkit.org/show_bug.cgi?id=7793680 if (element->hasTagName(HTMLNames::videoTag) || element->hasTagName(HTMLNames::audioTag))81 return false;82 83 78 // FIXME: ValidationMessage recreates shadow root dynamically. 84 79 // https://bugs.webkit.org/show_bug.cgi?id=77937 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r122787 r122816 1861 1861 } 1862 1862 1863 void HTMLMediaElement::createShadowSubtree() 1864 { 1865 ASSERT(!shadow() || !shadow()->oldestShadowRoot()); 1866 1867 ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot); 1868 } 1869 1870 void HTMLMediaElement::willAddAuthorShadowRoot() 1871 { 1872 ASSERT(shadow()); 1873 if (shadow()->oldestShadowRoot()) { 1874 ASSERT(shadow()->oldestShadowRoot()->type() == ShadowRoot::UserAgentShadowRoot); 1875 return; 1876 } 1877 1878 createShadowSubtree(); 1879 } 1880 1863 1881 void HTMLMediaElement::rewind(float timeDelta) 1864 1882 { … … 4191 4209 controls->enteredFullscreen(); 4192 4210 4193 ensureShadowRoot()->appendChild(controls, ec); 4211 if (!shadow()) 4212 createShadowSubtree(); 4213 4214 ASSERT(shadow()->oldestShadowRoot()->type() == ShadowRoot::UserAgentShadowRoot); 4215 shadow()->oldestShadowRoot()->appendChild(controls, ec); 4194 4216 return true; 4195 4217 } -
trunk/Source/WebCore/html/HTMLMediaElement.h
r122676 r122816 84 84 public: 85 85 MediaPlayer* player() const { return m_player.get(); } 86 86 87 void createShadowSubtree(); 88 virtual void willAddAuthorShadowRoot() OVERRIDE; 89 87 90 virtual bool isVideo() const = 0; 88 91 virtual bool hasVideo() const { return false; }
Note: See TracChangeset
for help on using the changeset viewer.