OLD | NEW |
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 Loading... |
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 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2779 bool preserve3D = useTransforms && (o->style()->preserves3D() || style()->pr
eserves3D()); | 2776 bool preserve3D = useTransforms && (o->style()->preserves3D() || style()->pr
eserves3D()); |
2780 if (useTransforms && shouldUseTransformFromContainer(o)) { | 2777 if (useTransforms && shouldUseTransformFromContainer(o)) { |
2781 TransformationMatrix t; | 2778 TransformationMatrix t; |
2782 getTransformFromContainer(o, containerOffset, t); | 2779 getTransformFromContainer(o, containerOffset, t); |
2783 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); | 2780 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); |
2784 } else | 2781 } else |
2785 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); | 2782 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); |
2786 } | 2783 } |
2787 | 2784 |
2788 } // namespace WebCore | 2785 } // namespace WebCore |
OLD | NEW |