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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved. |
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 | 92 |
93 enum StyleChangeType { | 93 enum StyleChangeType { |
94 NoStyleChange = 0, | 94 NoStyleChange = 0, |
95 LocalStyleChange = 1 << nodeStyleChangeShift, | 95 LocalStyleChange = 1 << nodeStyleChangeShift, |
96 SubtreeStyleChange = 2 << nodeStyleChangeShift, | 96 SubtreeStyleChange = 2 << nodeStyleChangeShift, |
97 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, | 97 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, |
98 }; | 98 }; |
99 | 99 |
100 class NodeRareDataBase { | 100 class NodeRareDataBase { |
101 public: | 101 public: |
102 LayoutObject* renderer() const { return m_renderer; } | 102 LayoutObject* layoutObject() const { return m_renderer; } |
103 void setRenderer(LayoutObject* renderer) { m_renderer = renderer; } | 103 void setRenderer(LayoutObject* renderer) { m_renderer = renderer; } |
leviw_travelin_and_unemployed
2015/03/04 20:15:30
Man this is weird :p
dsinclair
2015/03/04 20:37:56
Yea. Doing everything in one CL, I think, would be
| |
104 | 104 |
105 protected: | 105 protected: |
106 NodeRareDataBase(LayoutObject* renderer) | 106 NodeRareDataBase(LayoutObject* renderer) |
107 : m_renderer(renderer) | 107 : m_renderer(renderer) |
108 { } | 108 { } |
109 | 109 |
110 protected: | 110 protected: |
111 LayoutObject* m_renderer; | 111 LayoutObject* m_renderer; |
112 }; | 112 }; |
113 | 113 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 // Number of DOM 16-bit units contained in node. Note that rendered text len gth can be different - e.g. because of | 491 // Number of DOM 16-bit units contained in node. Note that rendered text len gth can be different - e.g. because of |
492 // css-transform:capitalize breaking up precomposed characters and ligatures . | 492 // css-transform:capitalize breaking up precomposed characters and ligatures . |
493 virtual int maxCharacterOffset() const; | 493 virtual int maxCharacterOffset() const; |
494 | 494 |
495 // Whether or not a selection can be started in this object | 495 // Whether or not a selection can be started in this object |
496 virtual bool canStartSelection() const; | 496 virtual bool canStartSelection() const; |
497 | 497 |
498 // ------------------------------------------------------------------------- ---- | 498 // ------------------------------------------------------------------------- ---- |
499 // Integration with rendering tree | 499 // Integration with rendering tree |
500 | 500 |
501 // As renderer() includes a branch you should avoid calling it repeatedly in hot code paths. | 501 // As layoutObject() includes a branch you should avoid calling it repeatedl y in hot code paths. |
502 // Note that if a Node has a renderer, it's parentNode is guaranteed to have one as well. | 502 // Note that if a Node has a renderer, it's parentNode is guaranteed to have one as well. |
503 LayoutObject* renderer() const { return hasRareData() ? m_data.m_rareData->r enderer() : m_data.m_renderer; }; | 503 LayoutObject* layoutObject() const { return hasRareData() ? m_data.m_rareDat a->layoutObject() : m_data.m_renderer; }; |
Julien - ping for review
2015/03/05 16:19:16
It's weird that layoutObject is in rare data.
dsinclair
2015/03/05 16:40:01
crbug.com/464392
| |
504 void setRenderer(LayoutObject* renderer) | 504 void setRenderer(LayoutObject* renderer) |
505 { | 505 { |
506 if (hasRareData()) | 506 if (hasRareData()) |
507 m_data.m_rareData->setRenderer(renderer); | 507 m_data.m_rareData->setRenderer(renderer); |
508 else | 508 else |
509 m_data.m_renderer = renderer; | 509 m_data.m_renderer = renderer; |
510 } | 510 } |
511 | 511 |
512 // Use these two methods with caution. | 512 // Use these two methods with caution. |
513 LayoutBox* layoutBox() const; | 513 LayoutBox* layoutBox() const; |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
900 } // namespace blink | 900 } // namespace blink |
901 | 901 |
902 #ifndef NDEBUG | 902 #ifndef NDEBUG |
903 // Outside the WebCore namespace for ease of invocation from gdb. | 903 // Outside the WebCore namespace for ease of invocation from gdb. |
904 void showNode(const blink::Node*); | 904 void showNode(const blink::Node*); |
905 void showTree(const blink::Node*); | 905 void showTree(const blink::Node*); |
906 void showNodePath(const blink::Node*); | 906 void showNodePath(const blink::Node*); |
907 #endif | 907 #endif |
908 | 908 |
909 #endif // Node_h | 909 #endif // Node_h |
OLD | NEW |