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

Unified Diff: Source/WebCore/rendering/RenderBoxModelObject.cpp

Issue 9695005: Merge 110323 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 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
Index: Source/WebCore/rendering/RenderBoxModelObject.cpp
===================================================================
--- Source/WebCore/rendering/RenderBoxModelObject.cpp (revision 110458)
+++ Source/WebCore/rendering/RenderBoxModelObject.cpp (working copy)
@@ -224,26 +224,23 @@
return gImageQualityController;
}
-void RenderBoxModelObject::setSelectionState(SelectionState s)
+void RenderBoxModelObject::setSelectionState(SelectionState state)
{
- if (selectionState() == s)
+ if (state == SelectionInside && selectionState() != SelectionNone)
return;
-
- if (s == SelectionInside && selectionState() != SelectionNone)
- return;
- if ((s == SelectionStart && selectionState() == SelectionEnd)
- || (s == SelectionEnd && selectionState() == SelectionStart))
+ if ((state == SelectionStart && selectionState() == SelectionEnd)
+ || (state == SelectionEnd && selectionState() == SelectionStart))
RenderObject::setSelectionState(SelectionBoth);
else
- RenderObject::setSelectionState(s);
-
- // FIXME:
- // We should consider whether it is OK propagating to ancestor RenderInlines.
+ RenderObject::setSelectionState(state);
+
+ // FIXME: We should consider whether it is OK propagating to ancestor RenderInlines.
// This is a workaround for http://webkit.org/b/32123
- RenderBlock* cb = containingBlock();
- if (cb && !cb->isRenderView())
- cb->setSelectionState(s);
+ // The containing block can be null in case of an orphaned tree.
+ RenderBlock* containingBlock = this->containingBlock();
+ if (containingBlock && !containingBlock->isRenderView())
+ containingBlock->setSelectionState(state);
}
bool RenderBoxModelObject::shouldPaintAtLowQuality(GraphicsContext* context, Image* image, const void* layer, const LayoutSize& size)
« no previous file with comments | « LayoutTests/editing/selection/first-letter-selection-crash-expected.txt ('k') | Source/WebCore/rendering/RenderListMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698