Index: third_party/WebKit/Source/core/dom/Fullscreen.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Fullscreen.cpp b/third_party/WebKit/Source/core/dom/Fullscreen.cpp |
index 3ac938b548ee3563d7a648d4d7a80e055e95c36c..73b227fb0c54e104bcca7770d8b92dbacfd2b1b7 100644 |
--- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp |
+++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp |
@@ -31,6 +31,7 @@ |
#include "core/dom/Document.h" |
#include "core/dom/ElementTraversal.h" |
#include "core/dom/StyleChangeReason.h" |
+#include "core/dom/StyleEngine.h" |
#include "core/events/Event.h" |
#include "core/frame/FrameHost.h" |
#include "core/frame/LocalFrame.h" |
@@ -446,8 +447,10 @@ void Fullscreen::didEnterFullScreenForElement(Element* element) |
m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true); |
- // FIXME: This should not call updateStyleIfNeeded. |
- document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::FullScreen)); |
+ document()->styleEngine().ensureFullscreenUAStyle(); |
+ m_fullScreenElement->pseudoStateChanged(CSSSelector::PseudoFullScreen); |
+ |
+ // FIXME: This should not call updateLayoutTree. |
document()->updateLayoutTree(); |
m_fullScreenElement->didBecomeFullscreenElement(); |
@@ -473,8 +476,8 @@ void Fullscreen::didExitFullScreenForElement(Element*) |
if (m_fullScreenLayoutObject) |
LayoutFullScreenItem(m_fullScreenLayoutObject).unwrapLayoutObject(); |
+ m_fullScreenElement->pseudoStateChanged(CSSSelector::PseudoFullScreen); |
m_fullScreenElement = nullptr; |
- document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::FullScreen)); |
if (document()->frame()) |
document()->frame()->eventHandler().scheduleHoverStateUpdate(); |