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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 #include "core/html/HTMLSlotElement.h" | 109 #include "core/html/HTMLSlotElement.h" |
110 #include "core/html/HTMLTableRowsCollection.h" | 110 #include "core/html/HTMLTableRowsCollection.h" |
111 #include "core/html/HTMLTemplateElement.h" | 111 #include "core/html/HTMLTemplateElement.h" |
112 #include "core/html/parser/HTMLParserIdioms.h" | 112 #include "core/html/parser/HTMLParserIdioms.h" |
113 #include "core/input/EventHandler.h" | 113 #include "core/input/EventHandler.h" |
114 #include "core/inspector/InspectorInstrumentation.h" | 114 #include "core/inspector/InspectorInstrumentation.h" |
115 #include "core/layout/LayoutTextFragment.h" | 115 #include "core/layout/LayoutTextFragment.h" |
116 #include "core/layout/api/LayoutBoxItem.h" | 116 #include "core/layout/api/LayoutBoxItem.h" |
117 #include "core/layout/api/LayoutViewItem.h" | 117 #include "core/layout/api/LayoutViewItem.h" |
118 #include "core/loader/DocumentLoader.h" | 118 #include "core/loader/DocumentLoader.h" |
| 119 #include "core/observer/ResizeObservation.h" |
119 #include "core/page/ChromeClient.h" | 120 #include "core/page/ChromeClient.h" |
120 #include "core/page/FocusController.h" | 121 #include "core/page/FocusController.h" |
121 #include "core/page/Page.h" | 122 #include "core/page/Page.h" |
122 #include "core/page/PointerLockController.h" | 123 #include "core/page/PointerLockController.h" |
123 #include "core/page/SpatialNavigation.h" | 124 #include "core/page/SpatialNavigation.h" |
124 #include "core/page/scrolling/RootScrollerController.h" | 125 #include "core/page/scrolling/RootScrollerController.h" |
125 #include "core/page/scrolling/ScrollCustomizationCallbacks.h" | 126 #include "core/page/scrolling/ScrollCustomizationCallbacks.h" |
126 #include "core/page/scrolling/ScrollState.h" | 127 #include "core/page/scrolling/ScrollState.h" |
127 #include "core/page/scrolling/ScrollStateCallback.h" | 128 #include "core/page/scrolling/ScrollStateCallback.h" |
128 #include "core/paint/PaintLayer.h" | 129 #include "core/paint/PaintLayer.h" |
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1616 document().activeChainNodeDetached(*this); | 1617 document().activeChainNodeDetached(*this); |
1617 document().userActionElements().didDetach(*this); | 1618 document().userActionElements().didDetach(*this); |
1618 } | 1619 } |
1619 | 1620 |
1620 if (context.clearInvalidation) | 1621 if (context.clearInvalidation) |
1621 document().styleEngine().styleInvalidator().clearInvalidation(*this); | 1622 document().styleEngine().styleInvalidator().clearInvalidation(*this); |
1622 | 1623 |
1623 if (svgFilterNeedsLayerUpdate()) | 1624 if (svgFilterNeedsLayerUpdate()) |
1624 document().unscheduleSVGFilterLayerUpdateHack(*this); | 1625 document().unscheduleSVGFilterLayerUpdateHack(*this); |
1625 | 1626 |
| 1627 sizeMayHaveChanged(); |
| 1628 |
1626 DCHECK(needsAttach()); | 1629 DCHECK(needsAttach()); |
1627 } | 1630 } |
1628 | 1631 |
1629 bool Element::pseudoStyleCacheIsInvalid(const ComputedStyle* currentStyle, Compu
tedStyle* newStyle) | 1632 bool Element::pseudoStyleCacheIsInvalid(const ComputedStyle* currentStyle, Compu
tedStyle* newStyle) |
1630 { | 1633 { |
1631 DCHECK_EQ(currentStyle, computedStyle()); | 1634 DCHECK_EQ(currentStyle, computedStyle()); |
1632 DCHECK(layoutObject()); | 1635 DCHECK(layoutObject()); |
1633 | 1636 |
1634 if (!currentStyle) | 1637 if (!currentStyle) |
1635 return false; | 1638 return false; |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2682 if (hasRareData()) | 2685 if (hasRareData()) |
2683 return elementRareData()->resizeObserverData(); | 2686 return elementRareData()->resizeObserverData(); |
2684 return nullptr; | 2687 return nullptr; |
2685 } | 2688 } |
2686 | 2689 |
2687 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>& Element::ensureR
esizeObserverData() | 2690 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>& Element::ensureR
esizeObserverData() |
2688 { | 2691 { |
2689 return ensureElementRareData().ensureResizeObserverData(); | 2692 return ensureElementRareData().ensureResizeObserverData(); |
2690 } | 2693 } |
2691 | 2694 |
| 2695 void Element::sizeMayHaveChanged() |
| 2696 { |
| 2697 if (auto* data = resizeObserverData()) { |
| 2698 for (auto& observation : data->values()) |
| 2699 observation->elementSizeChanged(); |
| 2700 } |
| 2701 } |
| 2702 |
2692 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() | 2703 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() |
2693 static Element* contextElementForInsertion(const String& where, Element* element
, ExceptionState& exceptionState) | 2704 static Element* contextElementForInsertion(const String& where, Element* element
, ExceptionState& exceptionState) |
2694 { | 2705 { |
2695 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft
erEnd")) { | 2706 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft
erEnd")) { |
2696 Element* parent = element->parentElement(); | 2707 Element* parent = element->parentElement(); |
2697 if (!parent) { | 2708 if (!parent) { |
2698 exceptionState.throwDOMException(NoModificationAllowedError, "The el
ement has no parent."); | 2709 exceptionState.throwDOMException(NoModificationAllowedError, "The el
ement has no parent."); |
2699 return nullptr; | 2710 return nullptr; |
2700 } | 2711 } |
2701 return parent; | 2712 return parent; |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3795 | 3806 |
3796 DEFINE_TRACE_WRAPPERS(Element) | 3807 DEFINE_TRACE_WRAPPERS(Element) |
3797 { | 3808 { |
3798 if (hasRareData()) { | 3809 if (hasRareData()) { |
3799 visitor->traceWrappers(elementRareData()); | 3810 visitor->traceWrappers(elementRareData()); |
3800 } | 3811 } |
3801 ContainerNode::traceWrappers(visitor); | 3812 ContainerNode::traceWrappers(visitor); |
3802 } | 3813 } |
3803 | 3814 |
3804 } // namespace blink | 3815 } // namespace blink |
OLD | NEW |