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

Side by Side Diff: Source/WebCore/rendering/RenderBoxModelObject.cpp

Issue 9762003: Merge 110323 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 static ImageQualityController* gImageQualityController = 0; 217 static ImageQualityController* gImageQualityController = 0;
218 218
219 static ImageQualityController* imageQualityController() 219 static ImageQualityController* imageQualityController()
220 { 220 {
221 if (!gImageQualityController) 221 if (!gImageQualityController)
222 gImageQualityController = new ImageQualityController; 222 gImageQualityController = new ImageQualityController;
223 223
224 return gImageQualityController; 224 return gImageQualityController;
225 } 225 }
226 226
227 void RenderBoxModelObject::setSelectionState(SelectionState s) 227 void RenderBoxModelObject::setSelectionState(SelectionState state)
228 { 228 {
229 if (selectionState() == s) 229 if (state == SelectionInside && selectionState() != SelectionNone)
230 return;
231
232 if (s == SelectionInside && selectionState() != SelectionNone)
233 return; 230 return;
234 231
235 if ((s == SelectionStart && selectionState() == SelectionEnd) 232 if ((state == SelectionStart && selectionState() == SelectionEnd)
236 || (s == SelectionEnd && selectionState() == SelectionStart)) 233 || (state == SelectionEnd && selectionState() == SelectionStart))
237 RenderObject::setSelectionState(SelectionBoth); 234 RenderObject::setSelectionState(SelectionBoth);
238 else 235 else
239 RenderObject::setSelectionState(s); 236 RenderObject::setSelectionState(state);
240 237
241 // FIXME: 238 // FIXME: We should consider whether it is OK propagating to ancestor Render Inlines.
242 // We should consider whether it is OK propagating to ancestor RenderInlines .
243 // This is a workaround for http://webkit.org/b/32123 239 // This is a workaround for http://webkit.org/b/32123
244 RenderBlock* cb = containingBlock(); 240 // The containing block can be null in case of an orphaned tree.
245 if (cb && !cb->isRenderView()) 241 RenderBlock* containingBlock = this->containingBlock();
246 cb->setSelectionState(s); 242 if (containingBlock && !containingBlock->isRenderView())
243 containingBlock->setSelectionState(state);
247 } 244 }
248 245
249 bool RenderBoxModelObject::shouldPaintAtLowQuality(GraphicsContext* context, Ima ge* image, const void* layer, const LayoutSize& size) 246 bool RenderBoxModelObject::shouldPaintAtLowQuality(GraphicsContext* context, Ima ge* image, const void* layer, const LayoutSize& size)
250 { 247 {
251 return imageQualityController()->shouldPaintAtLowQuality(context, this, imag e, layer, size); 248 return imageQualityController()->shouldPaintAtLowQuality(context, this, imag e, layer, size);
252 } 249 }
253 250
254 RenderBoxModelObject::RenderBoxModelObject(Node* node) 251 RenderBoxModelObject::RenderBoxModelObject(Node* node)
255 : RenderObject(node) 252 : RenderObject(node)
256 , m_layer(0) 253 , m_layer(0)
(...skipping 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2768 bool preserve3D = useTransforms && (o->style()->preserves3D() || style()->pr eserves3D()); 2765 bool preserve3D = useTransforms && (o->style()->preserves3D() || style()->pr eserves3D());
2769 if (useTransforms && shouldUseTransformFromContainer(o)) { 2766 if (useTransforms && shouldUseTransformFromContainer(o)) {
2770 TransformationMatrix t; 2767 TransformationMatrix t;
2771 getTransformFromContainer(o, containerOffset, t); 2768 getTransformFromContainer(o, containerOffset, t);
2772 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform); 2769 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform);
2773 } else 2770 } else
2774 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm); 2771 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm);
2775 } 2772 }
2776 2773
2777 } // namespace WebCore 2774 } // namespace WebCore
OLDNEW
« 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