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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "core/frame/Settings.h" | 45 #include "core/frame/Settings.h" |
46 #include "core/frame/UseCounter.h" | 46 #include "core/frame/UseCounter.h" |
47 #include "core/rendering/HitTestResult.h" | 47 #include "core/rendering/HitTestResult.h" |
48 #include "core/rendering/RenderFlexibleBox.h" | 48 #include "core/rendering/RenderFlexibleBox.h" |
49 #include "core/rendering/RenderGeometryMap.h" | 49 #include "core/rendering/RenderGeometryMap.h" |
50 #include "core/rendering/RenderImage.h" | 50 #include "core/rendering/RenderImage.h" |
51 #include "core/rendering/RenderImageResourceStyleImage.h" | 51 #include "core/rendering/RenderImageResourceStyleImage.h" |
52 #include "core/rendering/RenderInline.h" | 52 #include "core/rendering/RenderInline.h" |
53 #include "core/rendering/RenderLayer.h" | 53 #include "core/rendering/RenderLayer.h" |
54 #include "core/rendering/RenderObjectInlines.h" | 54 #include "core/rendering/RenderObjectInlines.h" |
| 55 #include "core/rendering/RenderParagraph.h" |
55 #include "core/rendering/RenderText.h" | 56 #include "core/rendering/RenderText.h" |
56 #include "core/rendering/RenderTheme.h" | 57 #include "core/rendering/RenderTheme.h" |
57 #include "core/rendering/RenderView.h" | 58 #include "core/rendering/RenderView.h" |
58 #include "core/rendering/compositing/CompositedLayerMapping.h" | 59 #include "core/rendering/compositing/CompositedLayerMapping.h" |
59 #include "core/rendering/compositing/RenderLayerCompositor.h" | 60 #include "core/rendering/compositing/RenderLayerCompositor.h" |
60 #include "core/rendering/style/ShadowList.h" | 61 #include "core/rendering/style/ShadowList.h" |
61 #include "platform/JSONValues.h" | 62 #include "platform/JSONValues.h" |
62 #include "platform/Partitions.h" | 63 #include "platform/Partitions.h" |
63 #include "platform/RuntimeEnabledFeatures.h" | 64 #include "platform/RuntimeEnabledFeatures.h" |
64 #include "platform/TraceEvent.h" | 65 #include "platform/TraceEvent.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 ASSERT(isAllowedToModifyRenderTreeStructure(element->document())); | 135 ASSERT(isAllowedToModifyRenderTreeStructure(element->document())); |
135 | 136 |
136 switch (style->display()) { | 137 switch (style->display()) { |
137 case NONE: | 138 case NONE: |
138 return 0; | 139 return 0; |
139 case INLINE: | 140 case INLINE: |
140 return new RenderInline(element); | 141 return new RenderInline(element); |
141 case BLOCK: | 142 case BLOCK: |
142 case INLINE_BLOCK: | 143 case INLINE_BLOCK: |
143 return new RenderBlockFlow(element); | 144 return new RenderBlockFlow(element); |
| 145 case PARAGRAPH: |
| 146 return new RenderParagraph(element); |
144 case FLEX: | 147 case FLEX: |
145 case INLINE_FLEX: | 148 case INLINE_FLEX: |
146 return new RenderFlexibleBox(element); | 149 return new RenderFlexibleBox(element); |
147 } | 150 } |
148 | 151 |
149 return 0; | 152 return 0; |
150 } | 153 } |
151 | 154 |
152 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, renderObjectCounter, ("Rend
erObject")); | 155 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, renderObjectCounter, ("Rend
erObject")); |
153 unsigned RenderObject::s_instanceCount = 0; | 156 unsigned RenderObject::s_instanceCount = 0; |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 return selectionColor(CSSPropertyWebkitTextEmphasisColor); | 1641 return selectionColor(CSSPropertyWebkitTextEmphasisColor); |
1639 } | 1642 } |
1640 | 1643 |
1641 void RenderObject::selectionStartEnd(int& spos, int& epos) const | 1644 void RenderObject::selectionStartEnd(int& spos, int& epos) const |
1642 { | 1645 { |
1643 view()->selectionStartEnd(spos, epos); | 1646 view()->selectionStartEnd(spos, epos); |
1644 } | 1647 } |
1645 | 1648 |
1646 void RenderObject::handleDynamicFloatPositionChange() | 1649 void RenderObject::handleDynamicFloatPositionChange() |
1647 { | 1650 { |
| 1651 // FIXME(sky): Inline this function. |
| 1652 |
1648 // We have gone from not affecting the inline status of the parent flow to s
uddenly | 1653 // We have gone from not affecting the inline status of the parent flow to s
uddenly |
1649 // having an impact. See if there is a mismatch between the parent flow's | 1654 // having an impact. See if there is a mismatch between the parent flow's |
1650 // childrenInline() state and our state. | 1655 // childrenInline() state and our state. |
1651 setInline(style()->isDisplayInlineType()); | 1656 setInline(style()->isDisplayInlineType()); |
1652 if (isInline() != parent()->childrenInline()) { | 1657 ASSERT(isInline() == parent()->childrenInline()); |
1653 if (!isInline()) | |
1654 toRenderBoxModelObject(parent())->childBecameNonInline(this); | |
1655 else { | |
1656 // An anonymous block must be made to wrap this inline. | |
1657 RenderBlock* block = toRenderBlock(parent())->createAnonymousBlock()
; | |
1658 RenderObjectChildList* childlist = parent()->virtualChildren(); | |
1659 childlist->insertChildNode(parent(), block, this); | |
1660 block->children()->appendChildNode(block, childlist->removeChildNode
(parent(), this)); | |
1661 } | |
1662 } | |
1663 } | 1658 } |
1664 | 1659 |
1665 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const | 1660 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const |
1666 { | 1661 { |
1667 // If transform changed, and the layer does not paint into its own separate
backing, then we need to invalidate paints. | 1662 // If transform changed, and the layer does not paint into its own separate
backing, then we need to invalidate paints. |
1668 if (diff.transformChanged()) { | 1663 if (diff.transformChanged()) { |
1669 // Text nodes share style with their parents but transforms don't apply
to them, | 1664 // Text nodes share style with their parents but transforms don't apply
to them, |
1670 // hence the !isText() check. | 1665 // hence the !isText() check. |
1671 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasStyleDeterminedDirectCompositingReasons())) | 1666 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer(
)->hasStyleDeterminedDirectCompositingReasons())) |
1672 diff.setNeedsPaintInvalidationLayer(); | 1667 diff.setNeedsPaintInvalidationLayer(); |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 { | 2678 { |
2684 if (object1) { | 2679 if (object1) { |
2685 const blink::RenderObject* root = object1; | 2680 const blink::RenderObject* root = object1; |
2686 while (root->parent()) | 2681 while (root->parent()) |
2687 root = root->parent(); | 2682 root = root->parent(); |
2688 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 2683 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
2689 } | 2684 } |
2690 } | 2685 } |
2691 | 2686 |
2692 #endif | 2687 #endif |
OLD | NEW |