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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 | 50 |
51 namespace blink { | 51 namespace blink { |
52 | 52 |
53 // The HashMap for storing continuation pointers. | 53 // The HashMap for storing continuation pointers. |
54 // An inline can be split with blocks occuring in between the inline content. | 54 // An inline can be split with blocks occuring in between the inline content. |
55 // When this occurs we need a pointer to the next object. We can basically be | 55 // When this occurs we need a pointer to the next object. We can basically be |
56 // split into a sequence of inlines and blocks. The continuation will either be | 56 // split into a sequence of inlines and blocks. The continuation will either be |
57 // an anonymous block (that houses other blocks) or it will be an inline flow. | 57 // an anonymous block (that houses other blocks) or it will be an inline flow. |
58 // <b><i><p>Hello</p></i></b>. In this example the <i> will have a block as | 58 // <b><i><p>Hello</p></i></b>. In this example the <i> will have a block as |
59 // its continuation but the <b> will just have an inline as its continuation. | 59 // its continuation but the <b> will just have an inline as its continuation. |
60 typedef WillBeHeapHashMap<RawPtrWillBeMember<const RenderBoxModelObject>, RawPtr WillBeMember<RenderBoxModelObject> > ContinuationMap; | 60 typedef HashMap<const RenderBoxModelObject*, RenderBoxModelObject*> Continuation Map; |
61 static OwnPtrWillBePersistent<ContinuationMap>* continuationMap = 0; | 61 static OwnPtr<ContinuationMap>* continuationMap = 0; |
tkent
2015/02/04 00:50:44
This should be |ContinuationMap* continuationMap =
haraken
2015/02/04 05:48:56
Can we use DEFINE_STATIC_LOCAL?
sof
2015/02/04 08:44:31
Possibly, but lazy initialization appears to matte
sof
2015/02/04 08:44:31
Reverted the use of OwnPtr<> & back to 10de152d4's
| |
62 | 62 |
63 void RenderBoxModelObject::setSelectionState(SelectionState state) | 63 void RenderBoxModelObject::setSelectionState(SelectionState state) |
64 { | 64 { |
65 if (state == SelectionInside && selectionState() != SelectionNone) | 65 if (state == SelectionInside && selectionState() != SelectionNone) |
66 return; | 66 return; |
67 | 67 |
68 if ((state == SelectionStart && selectionState() == SelectionEnd) | 68 if ((state == SelectionStart && selectionState() == SelectionEnd) |
69 || (state == SelectionEnd && selectionState() == SelectionStart)) | 69 || (state == SelectionEnd && selectionState() == SelectionStart)) |
70 RenderObject::setSelectionState(SelectionBoth); | 70 RenderObject::setSelectionState(SelectionBoth); |
71 else | 71 else |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 { | 465 { |
466 if (!continuationMap) | 466 if (!continuationMap) |
467 return 0; | 467 return 0; |
468 return (*continuationMap)->get(this); | 468 return (*continuationMap)->get(this); |
469 } | 469 } |
470 | 470 |
471 void RenderBoxModelObject::setContinuation(RenderBoxModelObject* continuation) | 471 void RenderBoxModelObject::setContinuation(RenderBoxModelObject* continuation) |
472 { | 472 { |
473 if (continuation) { | 473 if (continuation) { |
474 if (!continuationMap) | 474 if (!continuationMap) |
475 continuationMap = new OwnPtrWillBePersistent<ContinuationMap>(adoptP trWillBeNoop(new ContinuationMap)); | 475 continuationMap = new OwnPtr<ContinuationMap>(adoptPtr(new Continuat ionMap)); |
476 (*continuationMap)->set(this, continuation); | 476 (*continuationMap)->set(this, continuation); |
477 } else { | 477 } else { |
478 if (continuationMap) | 478 if (continuationMap) |
479 (*continuationMap)->remove(this); | 479 (*continuationMap)->remove(this); |
480 } | 480 } |
481 } | 481 } |
482 | 482 |
483 void RenderBoxModelObject::computeLayerHitTestRects(LayerHitTestRects& rects) co nst | 483 void RenderBoxModelObject::computeLayerHitTestRects(LayerHitTestRects& rects) co nst |
484 { | 484 { |
485 RenderLayerModelObject::computeLayerHitTestRects(rects); | 485 RenderLayerModelObject::computeLayerHitTestRects(rects); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
655 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 655 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
656 for (RenderObject* child = startChild; child && child != endChild; ) { | 656 for (RenderObject* child = startChild; child && child != endChild; ) { |
657 // Save our next sibling as moveChildTo will clear it. | 657 // Save our next sibling as moveChildTo will clear it. |
658 RenderObject* nextSibling = child->nextSibling(); | 658 RenderObject* nextSibling = child->nextSibling(); |
659 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 659 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
660 child = nextSibling; | 660 child = nextSibling; |
661 } | 661 } |
662 } | 662 } |
663 | 663 |
664 } // namespace blink | 664 } // namespace blink |
OLD | NEW |