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

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

Issue 7948002: Merge 94864 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 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 | « no previous file | 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 RenderObject* previousSibling = 0; 298 RenderObject* previousSibling = 0;
299 299
300 // Case 1: The node is a block and is an inline's continuation. In that case , the inline's 300 // Case 1: The node is a block and is an inline's continuation. In that case , the inline's
301 // last child is our previous sibling (or further back in the continuation c hain) 301 // last child is our previous sibling (or further back in the continuation c hain)
302 RenderInline* startOfConts; 302 RenderInline* startOfConts;
303 if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_re nderer))) 303 if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_re nderer)))
304 previousSibling = childBeforeConsideringContinuations(startOfConts, m_re nderer); 304 previousSibling = childBeforeConsideringContinuations(startOfConts, m_re nderer);
305 305
306 // Case 2: Anonymous block parent of the end of a continuation - skip all th e way to before 306 // Case 2: Anonymous block parent of the end of a continuation - skip all th e way to before
307 // the parent of the start, since everything in between will be linked up vi a the continuation. 307 // the parent of the start, since everything in between will be linked up vi a the continuation.
308 else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_ renderer)) 308 else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_ renderer)) {
309 previousSibling = startOfContinuations(m_renderer->firstChild())->parent ()->previousSibling(); 309 RenderObject* firstParent = startOfContinuations(m_renderer->firstChild( ))->parent();
310 while (firstChildIsInlineContinuation(firstParent))
311 firstParent = startOfContinuations(firstParent->firstChild())->paren t();
312 previousSibling = firstParent->previousSibling();
313 }
310 314
311 // Case 3: The node has an actual previous sibling 315 // Case 3: The node has an actual previous sibling
312 else if (RenderObject* ps = m_renderer->previousSibling()) 316 else if (RenderObject* ps = m_renderer->previousSibling())
313 previousSibling = ps; 317 previousSibling = ps;
314 318
315 // Case 4: This node has no previous siblings, but its parent is an inline, 319 // Case 4: This node has no previous siblings, but its parent is an inline,
316 // and is another node's inline continutation. Follow the continuation chain . 320 // and is another node's inline continutation. Follow the continuation chain .
317 else if (m_renderer->parent()->isRenderInline() && (startOfConts = startOfCo ntinuations(m_renderer->parent()))) 321 else if (m_renderer->parent()->isRenderInline() && (startOfConts = startOfCo ntinuations(m_renderer->parent())))
318 previousSibling = childBeforeConsideringContinuations(startOfConts, m_re nderer->parent()->firstChild()); 322 previousSibling = childBeforeConsideringContinuations(startOfConts, m_re nderer->parent()->firstChild());
319 323
(...skipping 16 matching lines...) Expand all
336 RenderObject* nextSibling = 0; 340 RenderObject* nextSibling = 0;
337 341
338 // Case 1: node is a block and has an inline continuation. Next sibling is t he inline continuation's 342 // Case 1: node is a block and has an inline continuation. Next sibling is t he inline continuation's
339 // first child. 343 // first child.
340 RenderInline* inlineContinuation; 344 RenderInline* inlineContinuation;
341 if (m_renderer->isRenderBlock() && (inlineContinuation = toRenderBlock(m_ren derer)->inlineElementContinuation())) 345 if (m_renderer->isRenderBlock() && (inlineContinuation = toRenderBlock(m_ren derer)->inlineElementContinuation()))
342 nextSibling = firstChildConsideringContinuation(inlineContinuation); 346 nextSibling = firstChildConsideringContinuation(inlineContinuation);
343 347
344 // Case 2: Anonymous block parent of the start of a continuation - skip all the way to 348 // Case 2: Anonymous block parent of the start of a continuation - skip all the way to
345 // after the parent of the end, since everything in between will be linked u p via the continuation. 349 // after the parent of the end, since everything in between will be linked u p via the continuation.
346 else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_render er)) 350 else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_render er)) {
347 nextSibling = endOfContinuations(m_renderer->lastChild())->parent()->nex tSibling(); 351 RenderObject* lastParent = endOfContinuations(m_renderer->lastChild())-> parent();
352 while (lastChildHasContinuation(lastParent))
353 lastParent = endOfContinuations(lastParent->lastChild())->parent();
354 nextSibling = lastParent->nextSibling();
355 }
348 356
349 // Case 3: node has an actual next sibling 357 // Case 3: node has an actual next sibling
350 else if (RenderObject* ns = m_renderer->nextSibling()) 358 else if (RenderObject* ns = m_renderer->nextSibling())
351 nextSibling = ns; 359 nextSibling = ns;
352 360
353 // Case 4: node is an inline with a continuation. Next sibling is the next s ibling of the end 361 // Case 4: node is an inline with a continuation. Next sibling is the next s ibling of the end
354 // of the continuation chain. 362 // of the continuation chain.
355 else if (isInlineWithContinuation(m_renderer)) 363 else if (isInlineWithContinuation(m_renderer))
356 nextSibling = endOfContinuations(m_renderer)->nextSibling(); 364 nextSibling = endOfContinuations(m_renderer)->nextSibling();
357 365
(...skipping 3501 matching lines...) Expand 10 before | Expand all | Expand 10 after
3859 3867
3860 m_roleForMSAA = msaaRoleForRenderer(m_renderer); 3868 m_roleForMSAA = msaaRoleForRenderer(m_renderer);
3861 3869
3862 if (m_roleForMSAA == UnknownRole) 3870 if (m_roleForMSAA == UnknownRole)
3863 m_roleForMSAA = roleValue(); 3871 m_roleForMSAA = roleValue();
3864 3872
3865 return m_roleForMSAA; 3873 return m_roleForMSAA;
3866 } 3874 }
3867 3875
3868 } // namespace WebCore 3876 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698