Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 static Element* nextLocalAncestorElement(Element* element) |
|
dcheng
2016/05/19 22:08:39
Suggestion: nextAncestorElement, since local is re
alexmos
2016/05/19 23:58:19
Done.
| |
| 3060 { | 3060 { |
| 3061 DCHECK(element); | 3061 DCHECK(element); |
| 3062 return element->parentElement() ? element->parentElement() : element->docume nt().localOwner(); | 3062 if (element->parentElement()) |
| 3063 return element->parentElement(); | |
| 3064 | |
| 3065 Frame* frame = element->document().frame(); | |
| 3066 if (!frame || !frame->owner()) | |
| 3067 return nullptr; | |
| 3068 | |
| 3069 // Find the next LocalFrame on the ancestor chain, and return the | |
| 3070 // corresponding <iframe> element for the remote child if it exists. | |
| 3071 while (frame->tree().parent() && frame->tree().parent()->isRemoteFrame()) | |
| 3072 frame = frame->tree().parent(); | |
| 3073 | |
| 3074 if (frame->owner() && frame->owner()->isLocal()) | |
| 3075 return toHTMLFrameOwnerElement(frame->owner()); | |
| 3076 | |
| 3077 return nullptr; | |
| 3063 } | 3078 } |
| 3064 | 3079 |
| 3065 void Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(boo l flag) | 3080 void Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(boo l flag) |
| 3066 { | 3081 { |
| 3067 for (Element* element = parentCrossingFrameBoundaries(this); element; elemen t = parentCrossingFrameBoundaries(element)) | 3082 for (Element* element = nextLocalAncestorElement(this); element; element = n extLocalAncestorElement(element)) |
| 3068 element->setContainsFullScreenElement(flag); | 3083 element->setContainsFullScreenElement(flag); |
| 3069 } | 3084 } |
| 3070 | 3085 |
| 3071 void Element::setIsInTopLayer(bool inTopLayer) | 3086 void Element::setIsInTopLayer(bool inTopLayer) |
| 3072 { | 3087 { |
| 3073 if (isInTopLayer() == inTopLayer) | 3088 if (isInTopLayer() == inTopLayer) |
| 3074 return; | 3089 return; |
| 3075 setElementFlag(IsInTopLayer, inTopLayer); | 3090 setElementFlag(IsInTopLayer, inTopLayer); |
| 3076 | 3091 |
| 3077 // We must ensure a reattach occurs so the layoutObject is inserted in the c orrect sibling order under LayoutView according to its | 3092 // 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 Loading... | |
| 3707 | 3722 |
| 3708 DEFINE_TRACE_WRAPPERS(Element) | 3723 DEFINE_TRACE_WRAPPERS(Element) |
| 3709 { | 3724 { |
| 3710 if (hasRareData()) { | 3725 if (hasRareData()) { |
| 3711 visitor->traceWrappers(elementRareData()); | 3726 visitor->traceWrappers(elementRareData()); |
| 3712 } | 3727 } |
| 3713 ContainerNode::traceWrappers(visitor); | 3728 ContainerNode::traceWrappers(visitor); |
| 3714 } | 3729 } |
| 3715 | 3730 |
| 3716 } // namespace blink | 3731 } // namespace blink |
| OLD | NEW |