Changeset 138923 in webkit
- Timestamp:
- Jan 6, 2013 10:10:27 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r138922 r138923 1 2013-01-06 Takashi Sakamoto <tasak@google.com> 2 3 [Shadow DOM]: crash in WebCore::ElementShadow::setValidityUndetermined 4 https://bugs.webkit.org/show_bug.cgi?id=106203 5 6 Reviewed by Hajime Morita. 7 8 InsertionPoint should check whether ElementShadow is available or not 9 before invoking its methods. 10 11 No new tests. Webcomponents_fuzzer reported this bug. Would like to 12 use the fuzzer to check this issue. 13 14 * html/shadow/InsertionPoint.cpp: 15 (WebCore::InsertionPoint::getDistributedNodes): 16 (WebCore::InsertionPoint::childrenChanged): 17 (WebCore::InsertionPoint::insertedInto): 18 Added ifs to check whether ElementShadow is available or not before 19 invoking ElementShadow's methods, i.e. setValidityUndetermined, 20 invalidateDistribution, and ensureDistributionDocument. 21 1 22 2013-01-06 Shinya Kawanaka <shinyak@chromium.org> 2 23 -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r137552 r138923 100 100 PassRefPtr<NodeList> InsertionPoint::getDistributedNodes() const 101 101 { 102 if (treeScope()->rootNode()->isShadowRoot()) 103 toShadowRoot(treeScope()->rootNode())->owner()->ensureDistributionFromDocument(); 102 ContainerNode* rootNode = treeScope()->rootNode(); 103 if (rootNode->isShadowRoot()) 104 if (ElementShadow* rootOwner = toShadowRoot(rootNode)->owner()) 105 rootOwner->ensureDistributionFromDocument(); 104 106 105 107 Vector<RefPtr<Node> > nodes; … … 120 122 HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); 121 123 if (ShadowRoot* root = containingShadowRoot()) 122 root->owner()->invalidateDistribution(); 124 if (ElementShadow* rootOwner = root->owner()) 125 rootOwner->invalidateDistribution(); 123 126 } 124 127 … … 128 131 129 132 if (ShadowRoot* root = containingShadowRoot()) { 130 root->owner()->setValidityUndetermined(); 131 root->owner()->invalidateDistribution(); 132 if (isActive() && !m_registeredWithShadowRoot && insertionPoint->treeScope()->rootNode() == root) { 133 m_registeredWithShadowRoot = true; 134 root->registerInsertionPoint(this); 133 if (ElementShadow* rootOwner = root->owner()) { 134 rootOwner->setValidityUndetermined(); 135 rootOwner->invalidateDistribution(); 136 if (isActive() && !m_registeredWithShadowRoot && insertionPoint->treeScope()->rootNode() == root) { 137 m_registeredWithShadowRoot = true; 138 root->registerInsertionPoint(this); 139 } 135 140 } 136 141 } 137 138 142 139 143 return InsertionDone;
Note: See TracChangeset
for help on using the changeset viewer.