Changeset 116508 in webkit
- Timestamp:
- May 9, 2012 2:26:57 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116506 r116508 1 2012-05-09 Shinya Kawanaka <shinyak@chromium.org> 2 3 Position should be able to have ShadowRoot as a container. 4 https://bugs.webkit.org/show_bug.cgi?id=82021 5 6 Reviewed by Ryosuke Niwa. 7 8 Skipped non-chromium port since SHADOW_DOM flag is not enabled in those platforms. 9 We will add bunch of tests for editing in Shadow DOM into editing/shadow later, 10 so I added the whole directory name to the skipped list. 11 12 * editing/shadow/doubleclick-on-meter-in-shadow-crash-expected.txt: Added. 13 * editing/shadow/doubleclick-on-meter-in-shadow-crash.html: Added. 14 * editing/shadow/rightclick-on-meter-in-shadow-crash-expected.txt: Added. 15 * editing/shadow/rightclick-on-meter-in-shadow-crash.html: Added. 16 * editing/shadow/shadow-selection-not-exported-expected.txt: Added. 17 * editing/shadow/shadow-selection-not-exported.html: Added. 18 * platform/efl/Skipped: 19 * platform/gtk/test_expectations.txt: 20 * platform/mac/Skipped: 21 * platform/qt/Skipped: 22 * platform/win/Skipped: 23 * platform/wincairo/Skipped: 24 * platform/wk2/Skipped: 25 1 26 2012-05-09 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 27 -
trunk/LayoutTests/platform/efl/Skipped
r116506 r116508 228 228 # ENABLE(SHADOW_DOM) is disabled 229 229 fast/dom/shadow 230 editing/shadow 230 231 231 232 # ENABLE(DATALIST) is disabled -
trunk/LayoutTests/platform/gtk/test_expectations.txt
r116404 r116508 237 237 // ENABLE(SHADOW_DOM) is disabled. 238 238 BUGWKGTK SKIP : fast/dom/shadow = FAIL 239 BUGWKGTK SKIP : editing/shadow = FAIL 239 240 240 241 // CSS Regions support not yet enabled. -
trunk/LayoutTests/platform/mac/Skipped
r116428 r116508 448 448 # ENABLE(SHADOW_DOM) is disabled. 449 449 fast/dom/shadow 450 editing/shadow 450 451 451 452 # JSC does not support setIsolatedWorldSecurityOrigin (http://webkit.org/b/61540) -
trunk/LayoutTests/platform/qt/Skipped
r116428 r116508 170 170 171 171 # ENABLE(SHADOW_DOM) is disabled. 172 editing/shadow 172 173 fast/dom/shadow/access-key.html 173 174 fast/dom/shadow/adopt-node-with-shadow-root.html -
trunk/LayoutTests/platform/win/Skipped
r116230 r116508 1478 1478 1479 1479 # ENABLE(SHADOW_DOM) is disabled. 1480 editing/shadow 1480 1481 fast/dom/shadow/content-element-api.html 1481 1482 fast/dom/shadow/content-element-outside-shadow.html -
trunk/LayoutTests/platform/wincairo/Skipped
r116074 r116508 1984 1984 1985 1985 # ENABLE(SHADOW_DOM) is disabled. 1986 editing/shadow 1986 1987 fast/dom/shadow/content-element-api.html 1987 1988 fast/dom/shadow/content-element-outside-shadow.html -
trunk/LayoutTests/platform/wk2/Skipped
r116009 r116508 1091 1091 1092 1092 # ENABLE(SHADOW_DOM) is disabled. 1093 editing/shadow 1093 1094 fast/dom/shadow/content-element-api.html 1094 1095 fast/dom/shadow/content-element-outside-shadow.html -
trunk/Source/WebCore/ChangeLog
r116507 r116508 1 2012-05-09 Shinya Kawanaka <shinyak@chromium.org> 2 3 Position should be able to have ShadowRoot as a container. 4 https://bugs.webkit.org/show_bug.cgi?id=82021 5 6 Reviewed by Ryosuke Niwa. 7 8 Since Position could not take a shadow root as a container node, pointing the direct children 9 of a shadow root was difficult. 10 11 This patch makes it enabled, and fixes a lot of crashes caused by that limitation. 12 Also, we confirm that ShadowRoot is not exposed to JavaScript layer. 13 14 Currently this change is only enabled if shadow dom flag is enabled, since we cannot 15 prove this change does not destroy the existing behavior. However, this change is really required 16 to fix other editing bugs in Shadow DOM. A bunch of patches and tests will be added to 17 fix other editing bugs and they will check this patch does not break editing. 18 We will also add a fuzzer to check the stability of editing in Shadow DOM later, and it will 19 also help to confirm the patch will not break the editing. 20 21 Tests: editing/shadow/doubleclick-on-meter-in-shadow-crash.html 22 editing/shadow/rightclick-on-meter-in-shadow-crash.html 23 editing/shadow/shadow-selection-not-exported.html 24 25 * dom/Position.cpp: 26 (WebCore::Position::Position): 27 (WebCore::Position::containerNode): 28 (WebCore::Position::parentAnchoredEquivalent): 29 (WebCore::Position::previous): 30 (WebCore::Position::next): 31 (WebCore::Position::atStartOfTree): 32 (WebCore::Position::atEndOfTree): 33 (WebCore::Position::findParent): 34 * dom/Position.h: 35 (WebCore): 36 (WebCore::positionInParentBeforeNode): 37 (WebCore::positionInParentAfterNode): 38 1 39 2012-05-09 Zoltan Horvath <zoltan@webkit.org> 2 40 -
trunk/Source/WebCore/dom/Position.cpp
r115460 r116508 34 34 #include "RenderBlock.h" 35 35 #include "RenderText.h" 36 #include "RuntimeEnabledFeatures.h" 36 37 #include "Text.h" 37 38 #include "TextIterator.h" … … 81 82 , m_isLegacyEditingPosition(true) 82 83 { 84 #if ENABLE(SHADOW_DOM) 85 ASSERT(RuntimeEnabledFeatures::shadowDOMEnabled() || !m_anchorNode || !m_anchorNode->isShadowRoot()); 86 #else 83 87 ASSERT(!m_anchorNode || !m_anchorNode->isShadowRoot()); 88 #endif 84 89 } 85 90 … … 90 95 , m_isLegacyEditingPosition(false) 91 96 { 97 #if ENABLE(SHADOW_DOM) 98 ASSERT(RuntimeEnabledFeatures::shadowDOMEnabled() || !m_anchorNode || !m_anchorNode->isShadowRoot()); 99 #else 92 100 ASSERT(!m_anchorNode || !m_anchorNode->isShadowRoot()); 101 #endif 102 93 103 ASSERT(anchorType != PositionIsOffsetInAnchor); 94 104 ASSERT(!((anchorType == PositionIsBeforeChildren || anchorType == PositionIsAfterChildren) … … 102 112 , m_isLegacyEditingPosition(false) 103 113 { 114 #if ENABLE(SHADOW_DOM) 115 ASSERT(RuntimeEnabledFeatures::shadowDOMEnabled() || !m_anchorNode || !editingIgnoresContent(m_anchorNode.get()) || !m_anchorNode->isShadowRoot()); 116 #else 104 117 ASSERT(!m_anchorNode || !editingIgnoresContent(m_anchorNode.get()) || !m_anchorNode->isShadowRoot()); 118 #endif 119 105 120 ASSERT(anchorType == PositionIsOffsetInAnchor); 106 121 } … … 144 159 case PositionIsBeforeAnchor: 145 160 case PositionIsAfterAnchor: 146 return m_anchorNode->nonShadowBoundaryParentNode();161 return findParent(m_anchorNode.get()); 147 162 } 148 163 ASSERT_NOT_REACHED(); … … 204 219 // FIXME: This should only be necessary for legacy positions, but is also needed for positions before and after Tables 205 220 if (m_offset <= 0 && (m_anchorType != PositionIsAfterAnchor && m_anchorType != PositionIsAfterChildren)) { 206 if ( m_anchorNode->nonShadowBoundaryParentNode() && (editingIgnoresContent(m_anchorNode.get()) || isTableElement(m_anchorNode.get())))221 if (findParent(m_anchorNode.get()) && (editingIgnoresContent(m_anchorNode.get()) || isTableElement(m_anchorNode.get()))) 207 222 return positionInParentBeforeNode(m_anchorNode.get()); 208 223 return Position(m_anchorNode.get(), 0, PositionIsOffsetInAnchor); … … 317 332 } 318 333 319 ContainerNode* parent = n->nonShadowBoundaryParentNode();334 ContainerNode* parent = findParent(n); 320 335 if (!parent) 321 336 return *this; … … 349 364 } 350 365 351 ContainerNode* parent = n->nonShadowBoundaryParentNode();366 ContainerNode* parent = findParent(n); 352 367 if (!parent) 353 368 return *this; … … 442 457 if (isNull()) 443 458 return true; 444 return ! deprecatedNode()->nonShadowBoundaryParentNode() && m_offset <= 0;459 return !findParent(deprecatedNode()) && m_offset <= 0; 445 460 } 446 461 … … 449 464 if (isNull()) 450 465 return true; 451 return ! deprecatedNode()->nonShadowBoundaryParentNode() && m_offset >= lastOffsetForEditing(deprecatedNode());466 return !findParent(deprecatedNode()) && m_offset >= lastOffsetForEditing(deprecatedNode()); 452 467 } 453 468 … … 833 848 { 834 849 return node && node->renderer() && node->renderer()->style()->userSelect() == SELECT_NONE; 850 } 851 852 ContainerNode* Position::findParent(const Node* node) 853 { 854 // FIXME: See http://web.ug/82697 855 856 #if ENABLE(SHADOW_DOM) 857 if (RuntimeEnabledFeatures::shadowDOMEnabled()) 858 return node->parentNode(); 859 #endif 860 861 return node->nonShadowBoundaryParentNode(); 835 862 } 836 863 -
trunk/Source/WebCore/dom/Position.h
r115460 r116508 190 190 static bool hasRenderedNonAnonymousDescendantsWithHeight(RenderObject*); 191 191 static bool nodeIsUserSelectNone(Node*); 192 193 static ContainerNode* findParent(const Node*); 192 194 193 195 void debugPosition(const char* msg = "") const; … … 204 206 int renderedOffset() const; 205 207 208 206 209 Position previousCharacterPosition(EAffinity) const; 207 210 Position nextCharacterPosition(EAffinity) const; … … 245 248 // that the caller is trying to make a position relative to a disconnected node (which is likely an error) 246 249 // Specifically, editing/deleting/delete-ligature-001.html crashes with ASSERT(node->parentNode()) 247 return Position( node->nonShadowBoundaryParentNode(), node->nodeIndex(), Position::PositionIsOffsetInAnchor);250 return Position(Position::findParent(node), node->nodeIndex(), Position::PositionIsOffsetInAnchor); 248 251 } 249 252 250 253 inline Position positionInParentAfterNode(const Node* node) 251 254 { 252 ASSERT( node->nonShadowBoundaryParentNode());253 return Position( node->nonShadowBoundaryParentNode(), node->nodeIndex() + 1, Position::PositionIsOffsetInAnchor);255 ASSERT(Position::findParent(node)); 256 return Position(Position::findParent(node), node->nodeIndex() + 1, Position::PositionIsOffsetInAnchor); 254 257 } 255 258
Note: See TracChangeset
for help on using the changeset viewer.