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

Unified Diff: Source/core/accessibility/AXRenderObject.cpp

Issue 383153007: Fixes for re-enabling more MSVC level 4 warnings: Source/core/ edition (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review comments Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/accessibility/AXObject.cpp ('k') | Source/core/core.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AXRenderObject.cpp
diff --git a/Source/core/accessibility/AXRenderObject.cpp b/Source/core/accessibility/AXRenderObject.cpp
index 358a883433934bb9347d6aa8db4dfb4d0ec641c8..51fdd094a8e067094c7475ae0dca017860c54310 100644
--- a/Source/core/accessibility/AXRenderObject.cpp
+++ b/Source/core/accessibility/AXRenderObject.cpp
@@ -1378,8 +1378,8 @@ AXObject* AXRenderObject::nextSibling() const
RenderObject* nextSibling = 0;
- RenderInline* inlineContinuation;
- if (m_renderer->isRenderBlock() && (inlineContinuation = toRenderBlock(m_renderer)->inlineElementContinuation())) {
+ RenderInline* inlineContinuation = m_renderer->isRenderBlock() ? toRenderBlock(m_renderer)->inlineElementContinuation() : 0;
+ if (inlineContinuation) {
// Case 1: node is a block and has an inline continuation. Next sibling is the inline continuation's first child.
nextSibling = firstChildConsideringContinuation(inlineContinuation);
} else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_renderer)) {
@@ -1953,23 +1953,26 @@ RenderObject* AXRenderObject::renderParentObject() const
if (!m_renderer)
return 0;
- RenderObject* parent = m_renderer->parent();
-
- RenderObject* startOfConts = 0;
- RenderObject* firstChild = 0;
- if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_renderer))) {
+ RenderObject* startOfConts = m_renderer->isRenderBlock() ? startOfContinuations(m_renderer) : 0;
+ if (startOfConts) {
// Case 1: node is a block and is an inline's continuation. Parent
// is the start of the continuation chain.
- parent = startOfConts;
- } else if (parent && parent->isRenderInline() && (startOfConts = startOfContinuations(parent))) {
+ return startOfConts;
+ }
+
+ RenderObject* parent = m_renderer->parent();
+ startOfConts = parent && parent->isRenderInline() ? startOfContinuations(parent) : 0;
+ if (startOfConts) {
// Case 2: node's parent is an inline which is some node's continuation; parent is
// the earliest node in the continuation chain.
- parent = startOfConts;
- } else if (parent && (firstChild = parent->slowFirstChild()) && firstChild->node()) {
+ return startOfConts;
+ }
+
+ RenderObject* firstChild = parent ? parent->slowFirstChild() : 0;
+ if (firstChild && firstChild->node()) {
// Case 3: The first sibling is the beginning of a continuation chain. Find the origin of that continuation.
// Get the node's renderer and follow that continuation chain until the first child is found.
- RenderObject* nodeRenderFirstChild = firstChild->node()->renderer();
- while (nodeRenderFirstChild != firstChild) {
+ for (RenderObject* nodeRenderFirstChild = firstChild->node()->renderer(); nodeRenderFirstChild != firstChild; nodeRenderFirstChild = firstChild->node()->renderer()) {
for (RenderObject* contsTest = nodeRenderFirstChild; contsTest; contsTest = nextContinuation(contsTest)) {
if (contsTest == firstChild) {
parent = nodeRenderFirstChild->parent();
@@ -1982,7 +1985,6 @@ RenderObject* AXRenderObject::renderParentObject() const
firstChild = newFirstChild;
if (!firstChild->node())
break;
- nodeRenderFirstChild = firstChild->node()->renderer();
}
}
« no previous file with comments | « Source/core/accessibility/AXObject.cpp ('k') | Source/core/core.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698