From bb2bc101c7aa6e299feec04b5077f7d4c9087aed Mon Sep 17 00:00:00 2001 From: Seonae Kim Date: Tue, 30 Apr 2013 18:36:58 +0900 Subject: [PATCH] [CherryPick] Fullscreen element should not share styles with its siblings [Title][CherryPick] Fullscreen element should not share styles with its siblings [Issue] N/A [Problem] The size of video element is calculated incorrectly sometimes when entering fullscreen. [Cause] If fullscreen element has sibling, do share the style of sibling element. [Solution] Cherry picked. [Cherry-Picker] Seonae Kim Fullscreen element should not share styles with it's siblings. https://bugs.webkit.org/show_bug.cgi?id=106888 Reviewed by NOBODY (OOPS!). Test: fullscreen/full-screen-no-style-sharing.html * css/StyleResolver.cpp: (WebCore::StyleResolver::canShareStyleWithElement): Change-Id: I533bad9411777947546fbf37e0c9bf32f7166593 --- .../full-screen-no-style-sharing-expected.txt | 3 +++ .../fullscreen/full-screen-no-style-sharing.html | 17 +++++++++++++++++ Source/WebCore/css/StyleResolver.cpp | 4 ++++ 3 files changed, 24 insertions(+) create mode 100644 LayoutTests/fullscreen/full-screen-no-style-sharing-expected.txt create mode 100644 LayoutTests/fullscreen/full-screen-no-style-sharing.html diff --git a/LayoutTests/fullscreen/full-screen-no-style-sharing-expected.txt b/LayoutTests/fullscreen/full-screen-no-style-sharing-expected.txt new file mode 100644 index 0000000..1539960 --- /dev/null +++ b/LayoutTests/fullscreen/full-screen-no-style-sharing-expected.txt @@ -0,0 +1,3 @@ +EVENT(webkitfullscreenchange) TEST(video2.clientWidth==document.body.clientWidth) OK +END OF TEST + diff --git a/LayoutTests/fullscreen/full-screen-no-style-sharing.html b/LayoutTests/fullscreen/full-screen-no-style-sharing.html new file mode 100644 index 0000000..fbefbbf --- /dev/null +++ b/LayoutTests/fullscreen/full-screen-no-style-sharing.html @@ -0,0 +1,17 @@ + + + + + + + diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp index 868886c..a62c158 100644 --- a/Source/WebCore/css/StyleResolver.cpp +++ b/Source/WebCore/css/StyleResolver.cpp @@ -1523,6 +1523,10 @@ bool StyleResolver::canShareStyleWithElement(StyledElement* element) const if (element->isLink() && m_elementLinkState != style->insideLink()) return false; +#if ENABLE(FULLSCREEN_API) + if (element == element->document()->webkitCurrentFullScreenElement() || m_element == m_element->document()->webkitCurrentFullScreenElement()) + return false; +#endif return true; } -- 2.7.4