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

Side by Side Diff: Source/WebCore/dom/Element.cpp

Issue 11415245: Merge 135914 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years 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
« no previous file with comments | « LayoutTests/fast/dom/adopt-node-crash-2-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom); 979 updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom);
980 } 980 }
981 } 981 }
982 982
983 ContainerNode::removedFrom(insertionPoint); 983 ContainerNode::removedFrom(insertionPoint);
984 } 984 }
985 985
986 void Element::attach() 986 void Element::attach()
987 { 987 {
988 suspendPostAttachCallbacks(); 988 suspendPostAttachCallbacks();
989 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; 989 {
990 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
991 createRendererIfNeeded();
990 992
991 createRendererIfNeeded(); 993 StyleResolverParentPusher parentPusher(this);
992 StyleResolverParentPusher parentPusher(this); 994 if (parentElement() && parentElement()->isInCanvasSubtree())
995 setIsInCanvasSubtree(true);
993 996
994 if (parentElement() && parentElement()->isInCanvasSubtree()) 997 // When a shadow root exists, it does the work of attaching the children .
995 setIsInCanvasSubtree(true); 998 if (ElementShadow* shadow = this->shadow()) {
999 parentPusher.push();
1000 shadow->attach();
1001 } else {
1002 if (firstChild())
1003 parentPusher.push();
1004 }
1005 ContainerNode::attach();
996 1006
997 // When a shadow root exists, it does the work of attaching the children. 1007 if (hasRareData()) {
998 if (ElementShadow* shadow = this->shadow()) { 1008 ElementRareData* data = elementRareData();
999 parentPusher.push(); 1009 if (data->needsFocusAppearanceUpdateSoonAfterAttach()) {
1000 shadow->attach(); 1010 if (isFocusable() && document()->focusedNode() == this)
1001 } else { 1011 document()->updateFocusAppearanceSoon(false /* don't restore selection */);
1002 if (firstChild()) 1012 data->setNeedsFocusAppearanceUpdateSoonAfterAttach(false);
1003 parentPusher.push(); 1013 }
1004 }
1005 ContainerNode::attach();
1006
1007 if (hasRareData()) {
1008 ElementRareData* data = elementRareData();
1009 if (data->needsFocusAppearanceUpdateSoonAfterAttach()) {
1010 if (isFocusable() && document()->focusedNode() == this)
1011 document()->updateFocusAppearanceSoon(false /* don't restore sel ection */);
1012 data->setNeedsFocusAppearanceUpdateSoonAfterAttach(false);
1013 } 1014 }
1014 } 1015 }
1015
1016 resumePostAttachCallbacks(); 1016 resumePostAttachCallbacks();
1017 } 1017 }
1018 1018
1019 void Element::unregisterNamedFlowContentNode() 1019 void Element::unregisterNamedFlowContentNode()
1020 { 1020 {
1021 if (document()->cssRegionsEnabled() && inNamedFlow()) { 1021 if (document()->cssRegionsEnabled() && inNamedFlow()) {
1022 if (document()->renderer() && document()->renderer()->view()) 1022 if (document()->renderer() && document()->renderer()->view())
1023 document()->renderer()->view()->flowThreadController()->unregisterNa medFlowContentNode(this); 1023 document()->renderer()->view()->flowThreadController()->unregisterNa medFlowContentNode(this);
1024 } 1024 }
1025 } 1025 }
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 2316
2317 void Element::createMutableAttributeData() 2317 void Element::createMutableAttributeData()
2318 { 2318 {
2319 if (!m_attributeData) 2319 if (!m_attributeData)
2320 m_attributeData = ElementAttributeData::create(); 2320 m_attributeData = ElementAttributeData::create();
2321 else 2321 else
2322 m_attributeData = m_attributeData->makeMutableCopy(); 2322 m_attributeData = m_attributeData->makeMutableCopy();
2323 } 2323 }
2324 2324
2325 } // namespace WebCore 2325 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/adopt-node-crash-2-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698