Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1914643005: Add support for entering/exiting HTML fullscreen from OOPIFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Daniel's comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 3038 matching lines...) Expand 10 before | Expand all | Expand 10 after
3049 setAttribute(attributeName, AtomicString::number(value)); 3049 setAttribute(attributeName, AtomicString::number(value));
3050 } 3050 }
3051 3051
3052 void Element::setContainsFullScreenElement(bool flag) 3052 void Element::setContainsFullScreenElement(bool flag)
3053 { 3053 {
3054 setElementFlag(ContainsFullScreenElement, flag); 3054 setElementFlag(ContainsFullScreenElement, flag);
3055 document().styleEngine().ensureFullscreenUAStyle(); 3055 document().styleEngine().ensureFullscreenUAStyle();
3056 pseudoStateChanged(CSSSelector::PseudoFullScreenAncestor); 3056 pseudoStateChanged(CSSSelector::PseudoFullScreenAncestor);
3057 } 3057 }
3058 3058
3059 static Element* parentCrossingFrameBoundaries(Element* element) 3059 // Unlike Node::parentNode, this can cross frame boundaries.
3060 static Element* nextAncestorElement(Element* element)
3060 { 3061 {
3061 DCHECK(element); 3062 DCHECK(element);
3062 return element->parentElement() ? element->parentElement() : element->docume nt().localOwner(); 3063 if (element->parentElement())
3064 return element->parentElement();
3065
3066 Frame* frame = element->document().frame();
3067 if (!frame || !frame->owner())
3068 return nullptr;
3069
3070 // Find the next LocalFrame on the ancestor chain, and return the
3071 // corresponding <iframe> element for the remote child if it exists.
3072 while (frame->tree().parent() && frame->tree().parent()->isRemoteFrame())
3073 frame = frame->tree().parent();
3074
3075 if (frame->owner() && frame->owner()->isLocal())
3076 return toHTMLFrameOwnerElement(frame->owner());
3077
3078 return nullptr;
3063 } 3079 }
3064 3080
3065 void Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(boo l flag) 3081 void Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(boo l flag)
3066 { 3082 {
3067 for (Element* element = parentCrossingFrameBoundaries(this); element; elemen t = parentCrossingFrameBoundaries(element)) 3083 for (Element* element = nextAncestorElement(this); element; element = nextAn cestorElement(element))
3068 element->setContainsFullScreenElement(flag); 3084 element->setContainsFullScreenElement(flag);
3069 } 3085 }
3070 3086
3071 void Element::setIsInTopLayer(bool inTopLayer) 3087 void Element::setIsInTopLayer(bool inTopLayer)
3072 { 3088 {
3073 if (isInTopLayer() == inTopLayer) 3089 if (isInTopLayer() == inTopLayer)
3074 return; 3090 return;
3075 setElementFlag(IsInTopLayer, inTopLayer); 3091 setElementFlag(IsInTopLayer, inTopLayer);
3076 3092
3077 // We must ensure a reattach occurs so the layoutObject is inserted in the c orrect sibling order under LayoutView according to its 3093 // We must ensure a reattach occurs so the layoutObject is inserted in the c orrect sibling order under LayoutView according to its
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
3707 3723
3708 DEFINE_TRACE_WRAPPERS(Element) 3724 DEFINE_TRACE_WRAPPERS(Element)
3709 { 3725 {
3710 if (hasRareData()) { 3726 if (hasRareData()) {
3711 visitor->traceWrappers(elementRareData()); 3727 visitor->traceWrappers(elementRareData());
3712 } 3728 }
3713 ContainerNode::traceWrappers(visitor); 3729 ContainerNode::traceWrappers(visitor);
3714 } 3730 }
3715 3731
3716 } // namespace blink 3732 } // namespace blink
OLDNEW
« no previous file with comments | « content/test/data/fullscreen_frame.html ('k') | third_party/WebKit/Source/core/dom/Fullscreen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698