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

Side by Side Diff: Source/WebCore/accessibility/AccessibilityRenderObject.cpp

Issue 8036039: Merge 94864 - Source/WebCore: Assert being hit in AccessibilityRenderObject::addChildren() (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 2 months 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/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 RenderObject* previousSibling = 0; 297 RenderObject* previousSibling = 0;
298 298
299 // Case 1: The node is a block and is an inline's continuation. In that case , the inline's 299 // Case 1: The node is a block and is an inline's continuation. In that case , the inline's
300 // last child is our previous sibling (or further back in the continuation c hain) 300 // last child is our previous sibling (or further back in the continuation c hain)
301 RenderInline* startOfConts; 301 RenderInline* startOfConts;
302 if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_re nderer))) 302 if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_re nderer)))
303 previousSibling = childBeforeConsideringContinuations(startOfConts, m_re nderer); 303 previousSibling = childBeforeConsideringContinuations(startOfConts, m_re nderer);
304 304
305 // Case 2: Anonymous block parent of the end of a continuation - skip all th e way to before 305 // Case 2: Anonymous block parent of the end of a continuation - skip all th e way to before
306 // the parent of the start, since everything in between will be linked up vi a the continuation. 306 // the parent of the start, since everything in between will be linked up vi a the continuation.
307 else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_ renderer)) 307 else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_ renderer)) {
308 previousSibling = startOfContinuations(m_renderer->firstChild())->parent ()->previousSibling(); 308 RenderObject* firstParent = startOfContinuations(m_renderer->firstChild( ))->parent();
309 while (firstChildIsInlineContinuation(firstParent))
310 firstParent = startOfContinuations(firstParent->firstChild())->paren t();
311 previousSibling = firstParent->previousSibling();
312 }
309 313
310 // Case 3: The node has an actual previous sibling 314 // Case 3: The node has an actual previous sibling
311 else if (RenderObject* ps = m_renderer->previousSibling()) 315 else if (RenderObject* ps = m_renderer->previousSibling())
312 previousSibling = ps; 316 previousSibling = ps;
313 317
314 // Case 4: This node has no previous siblings, but its parent is an inline, 318 // Case 4: This node has no previous siblings, but its parent is an inline,
315 // and is another node's inline continutation. Follow the continuation chain . 319 // and is another node's inline continutation. Follow the continuation chain .
316 else if (m_renderer->parent()->isRenderInline() && (startOfConts = startOfCo ntinuations(m_renderer->parent()))) 320 else if (m_renderer->parent()->isRenderInline() && (startOfConts = startOfCo ntinuations(m_renderer->parent())))
317 previousSibling = childBeforeConsideringContinuations(startOfConts, m_re nderer->parent()->firstChild()); 321 previousSibling = childBeforeConsideringContinuations(startOfConts, m_re nderer->parent()->firstChild());
318 322
(...skipping 16 matching lines...) Expand all
335 RenderObject* nextSibling = 0; 339 RenderObject* nextSibling = 0;
336 340
337 // Case 1: node is a block and has an inline continuation. Next sibling is t he inline continuation's 341 // Case 1: node is a block and has an inline continuation. Next sibling is t he inline continuation's
338 // first child. 342 // first child.
339 RenderInline* inlineContinuation; 343 RenderInline* inlineContinuation;
340 if (m_renderer->isRenderBlock() && (inlineContinuation = toRenderBlock(m_ren derer)->inlineElementContinuation())) 344 if (m_renderer->isRenderBlock() && (inlineContinuation = toRenderBlock(m_ren derer)->inlineElementContinuation()))
341 nextSibling = firstChildConsideringContinuation(inlineContinuation); 345 nextSibling = firstChildConsideringContinuation(inlineContinuation);
342 346
343 // Case 2: Anonymous block parent of the start of a continuation - skip all the way to 347 // Case 2: Anonymous block parent of the start of a continuation - skip all the way to
344 // after the parent of the end, since everything in between will be linked u p via the continuation. 348 // after the parent of the end, since everything in between will be linked u p via the continuation.
345 else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_render er)) 349 else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_render er)) {
346 nextSibling = endOfContinuations(m_renderer->lastChild())->parent()->nex tSibling(); 350 RenderObject* lastParent = endOfContinuations(m_renderer->lastChild())-> parent();
351 while (lastChildHasContinuation(lastParent))
352 lastParent = endOfContinuations(lastParent->lastChild())->parent();
353 nextSibling = lastParent->nextSibling();
354 }
347 355
348 // Case 3: node has an actual next sibling 356 // Case 3: node has an actual next sibling
349 else if (RenderObject* ns = m_renderer->nextSibling()) 357 else if (RenderObject* ns = m_renderer->nextSibling())
350 nextSibling = ns; 358 nextSibling = ns;
351 359
352 // Case 4: node is an inline with a continuation. Next sibling is the next s ibling of the end 360 // Case 4: node is an inline with a continuation. Next sibling is the next s ibling of the end
353 // of the continuation chain. 361 // of the continuation chain.
354 else if (isInlineWithContinuation(m_renderer)) 362 else if (isInlineWithContinuation(m_renderer))
355 nextSibling = endOfContinuations(m_renderer)->nextSibling(); 363 nextSibling = endOfContinuations(m_renderer)->nextSibling();
356 364
(...skipping 3398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3755 3763
3756 m_roleForMSAA = msaaRoleForRenderer(m_renderer); 3764 m_roleForMSAA = msaaRoleForRenderer(m_renderer);
3757 3765
3758 if (m_roleForMSAA == UnknownRole) 3766 if (m_roleForMSAA == UnknownRole)
3759 m_roleForMSAA = roleValue(); 3767 m_roleForMSAA = roleValue();
3760 3768
3761 return m_roleForMSAA; 3769 return m_roleForMSAA;
3762 } 3770 }
3763 3771
3764 } // namespace WebCore 3772 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698