Changeset 156038 in webkit
- Timestamp:
- Sep 18, 2013, 7:33:55 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r155992 r156038 2200 2200 rendering/RenderView.cpp 2201 2201 rendering/RenderWidget.cpp 2202 rendering/RenderWordBreak.cpp2203 2202 rendering/RootInlineBox.cpp 2204 2203 rendering/ScrollBehavior.cpp -
trunk/Source/WebCore/ChangeLog
r156037 r156038 1 2013-09-18 Antti Koivisto <antti@apple.com> 2 3 Remove RenderWordBreak 4 https://bugs.webkit.org/show_bug.cgi?id=121549 5 6 Reviewed by Andreas Kling. 7 8 Remove RenderWordBreak and make it a bit in RenderBR instead. 9 10 * CMakeLists.txt: 11 * GNUmakefile.list.am: 12 * Target.pri: 13 * WebCore.vcxproj/WebCore.vcxproj: 14 * WebCore.xcodeproj/project.pbxproj: 15 * dom/Document.cpp: 16 (WebCore::Document::updateHoverActiveState): 17 * dom/Position.cpp: 18 (WebCore::hasInlineBoxWrapper): 19 (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight): 20 * editing/Editor.cpp: 21 (WebCore::findFirstMarkable): 22 * editing/TextIterator.cpp: 23 (WebCore::ignoresContainerClip): 24 * html/HTMLElement.cpp: 25 (WebCore::HTMLElement::createRenderer): 26 * rendering/InlineBox.cpp: 27 (WebCore::InlineBox::logicalHeight): 28 (WebCore::InlineBox::baselinePosition): 29 (WebCore::InlineBox::lineHeight): 30 (WebCore::InlineBox::deleteLine): 31 (WebCore::InlineBox::extractLine): 32 (WebCore::InlineBox::attachLine): 33 (WebCore::InlineBox::nodeAtPoint): 34 * rendering/InlineBox.h: 35 (WebCore::InlineBox::isLineBreak): 36 * rendering/InlineFlowBox.cpp: 37 (WebCore::InlineFlowBox::addToLine): 38 (WebCore::InlineFlowBox::computeOverflow): 39 * rendering/InlineIterator.h: 40 (WebCore::InlineIterator::atTextParagraphSeparator): 41 (WebCore::isIteratorTarget): 42 * rendering/RenderBR.cpp: 43 (WebCore::RenderBR::RenderBR): 44 * rendering/RenderBR.h: 45 (WebCore::toRenderBR): 46 47 RenderBR now represents both hard and soft line breaks. It will be renamed to RenderLineBreak later. 48 49 * rendering/RenderBlock.cpp: 50 (WebCore::InlineMinMaxIterator::next): 51 (WebCore::RenderBlock::computeInlinePreferredLogicalWidths): 52 * rendering/RenderBlockLineLayout.cpp: 53 (WebCore::createInlineBoxForRenderer): 54 (WebCore::dirtyLineBoxesForRenderer): 55 (WebCore::RenderBlock::computeBlockDirectionPositionsForLine): 56 (WebCore::RenderBlockFlow::layoutInlineChildren): 57 (WebCore::textBeginsWithBreakablePosition): 58 (WebCore::canBreakAtThisPosition): 59 (WebCore::RenderBlock::LineBreaker::nextSegmentBreak): 60 * rendering/RenderInline.cpp: 61 (WebCore::RenderInline::generateCulledLineBoxRects): 62 (WebCore::RenderInline::culledInlineFirstLineBox): 63 (WebCore::RenderInline::culledInlineLastLineBox): 64 (WebCore::RenderInline::dirtyLineBoxes): 65 * rendering/RenderLineBoxList.cpp: 66 (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): 67 * rendering/RenderObject.h: 68 (WebCore::RenderObject::isLineBreak): 69 70 This bit covers both BR and WBR. 71 72 (WebCore::RenderObject::isBR): 73 (WebCore::RenderObject::isLineBreakOpportunity): 74 75 Rename isWordBreak to isLineBreakOpportunity. This matches HTML5 spec terminology. 76 77 (WebCore::RenderObject::isTextOrLineBreak): 78 79 Since WBR used to be Text we want this check to still cover it too. Renamed from isTextOrBR. 80 81 (WebCore::RenderObject::setIsLineBreak): 82 (WebCore::RenderObject::isWBR): 83 (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields): 84 * rendering/RenderObjectChildList.cpp: 85 (WebCore::RenderObjectChildList::removeChildNode): 86 * rendering/RenderText.cpp: 87 * rendering/RenderText.h: 88 * rendering/RenderTreeAsText.cpp: 89 (WebCore::RenderTreeAsText::writeRenderObject): 90 * rendering/RenderWordBreak.cpp: Removed. 91 * rendering/RenderWordBreak.h: Removed. 92 * rendering/RenderingAllInOne.cpp: 93 * rendering/RootInlineBox.cpp: 94 (WebCore::RootInlineBox::ascentAndDescentForBox): 95 (WebCore::RootInlineBox::verticalPositionForBox): 96 (WebCore::RootInlineBox::includeLeadingForBox): 97 (WebCore::RootInlineBox::includeFontForBox): 98 (WebCore::RootInlineBox::includeGlyphsForBox): 99 (WebCore::RootInlineBox::includeMarginForBox): 100 1 101 2013-09-18 Csaba Osztrogonác <ossy@webkit.org> 2 102 -
trunk/Source/WebCore/GNUmakefile.list.am
r155992 r156038 4555 4555 Source/WebCore/rendering/RenderWidget.cpp \ 4556 4556 Source/WebCore/rendering/RenderWidget.h \ 4557 Source/WebCore/rendering/RenderWordBreak.cpp \4558 Source/WebCore/rendering/RenderWordBreak.h \4559 4557 Source/WebCore/rendering/RootInlineBox.cpp \ 4560 4558 Source/WebCore/rendering/RootInlineBox.h \ -
trunk/Source/WebCore/Target.pri
r156006 r156038 1226 1226 rendering/RenderView.cpp \ 1227 1227 rendering/RenderWidget.cpp \ 1228 rendering/RenderWordBreak.cpp \1229 1228 rendering/RootInlineBox.cpp \ 1230 1229 rendering/ScrollBehavior.cpp \ … … 2494 2493 rendering/RenderView.h \ 2495 2494 rendering/RenderWidget.h \ 2496 rendering/RenderWordBreak.h \2497 2495 rendering/RootInlineBox.h \ 2498 2496 rendering/ScrollBehavior.h \ -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r155797 r156038 10971 10971 </ClCompile> 10972 10972 <ClCompile Include="..\rendering\RenderWidget.cpp"> 10973 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>10974 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>10975 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>10976 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>10977 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>10978 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>10979 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>10980 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>10981 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>10982 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>10983 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>10984 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>10985 </ClCompile>10986 <ClCompile Include="..\rendering\RenderWordBreak.cpp">10987 10973 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 10988 10974 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> … … 20079 20065 <ClInclude Include="..\rendering\RenderView.h" /> 20080 20066 <ClInclude Include="..\rendering\RenderWidget.h" /> 20081 <ClInclude Include="..\rendering\RenderWordBreak.h" />20082 20067 <ClInclude Include="..\rendering\RootInlineBox.h" /> 20083 20068 <ClInclude Include="..\rendering\ScrollBehavior.h" /> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r155992 r156038 143 143 076306E117E16089005A7C4E /* JSSourceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 076306DF17E16089005A7C4E /* JSSourceInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 144 144 076306E317E22A43005A7C4E /* MediaStreamTrackSourcesRequestClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 076306E217E22A43005A7C4E /* MediaStreamTrackSourcesRequestClient.h */; }; 145 076306E717E251EC005A7C4E /* JSMediaStreamTrackSourcesCallbackCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 076306E617E251EC005A7C4E /* JSMediaStreamTrackSourcesCallbackCustom.h */; };146 145 076970861463AD8700F502CF /* TextTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076970841463AD8700F502CF /* TextTrackList.cpp */; }; 147 146 076970871463AD8700F502CF /* TextTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = 076970851463AD8700F502CF /* TextTrackList.h */; }; … … 2959 2958 9370918D1416D86B00477333 /* textAreaResizeCorner@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */; }; 2960 2959 9377ABA015DEFEEF0031FD04 /* Pagination.h in Headers */ = {isa = PBXBuildFile; fileRef = 9377AB9F15DEFEEF0031FD04 /* Pagination.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2961 93799EF80BF2743600D0F230 /* RenderWordBreak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */; };2962 93799EF90BF2743600D0F230 /* RenderWordBreak.h in Headers */ = {isa = PBXBuildFile; fileRef = 93799EF70BF2743600D0F230 /* RenderWordBreak.h */; };2963 2960 9380F47309A11AB4001FDB34 /* Widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9380F47109A11AB4001FDB34 /* Widget.cpp */; }; 2964 2961 9380F47409A11AB4001FDB34 /* Widget.h in Headers */ = {isa = PBXBuildFile; fileRef = 9380F47209A11AB4001FDB34 /* Widget.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6578 6575 076306DF17E16089005A7C4E /* JSSourceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSourceInfo.h; sourceTree = "<group>"; }; 6579 6576 076306E217E22A43005A7C4E /* MediaStreamTrackSourcesRequestClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamTrackSourcesRequestClient.h; sourceTree = "<group>"; }; 6580 076306E617E251EC005A7C4E /* JSMediaStreamTrackSourcesCallbackCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaStreamTrackSourcesCallbackCustom.h; sourceTree = "<group>"; };6581 6577 076970841463AD8700F502CF /* TextTrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackList.cpp; sourceTree = "<group>"; }; 6582 6578 076970851463AD8700F502CF /* TextTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackList.h; sourceTree = "<group>"; }; … … 9512 9508 9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "textAreaResizeCorner@2x.png"; sourceTree = "<group>"; }; 9513 9509 9377AB9F15DEFEEF0031FD04 /* Pagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pagination.h; sourceTree = "<group>"; }; 9514 93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderWordBreak.cpp; sourceTree = "<group>"; };9515 93799EF70BF2743600D0F230 /* RenderWordBreak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderWordBreak.h; sourceTree = "<group>"; };9516 9510 9380F47109A11AB4001FDB34 /* Widget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Widget.cpp; sourceTree = "<group>"; }; 9517 9511 9380F47209A11AB4001FDB34 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Widget.h; sourceTree = "<group>"; }; … … 20587 20581 A871DFE10A15376B00B12A68 /* RenderWidget.cpp */, 20588 20582 A871DFE00A15376B00B12A68 /* RenderWidget.h */, 20589 93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */,20590 93799EF70BF2743600D0F230 /* RenderWordBreak.h */,20591 20583 A8CFF5E00A155A05000A4234 /* RootInlineBox.cpp */, 20592 20584 A8CFF5DA0A155A05000A4234 /* RootInlineBox.h */, … … 23726 23718 BCEA4868097D93020094C9E4 /* RenderView.h in Headers */, 23727 23719 A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */, 23728 93799EF90BF2743600D0F230 /* RenderWordBreak.h in Headers */,23729 23720 078E094717D16E1C00420AA1 /* RTCVoidRequest.h in Headers */, 23730 23721 A89CCC530F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h in Headers */, … … 26893 26884 BCEA4867097D93020094C9E4 /* RenderView.cpp in Sources */, 26894 26885 A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */, 26895 93799EF80BF2743600D0F230 /* RenderWordBreak.cpp in Sources */,26896 26886 A89CCC520F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp in Sources */, 26897 26887 93309E09099E64920056E581 /* ReplaceSelectionCommand.cpp in Sources */, -
trunk/Source/WebCore/dom/Document.cpp
r155975 r156038 5825 5825 // will need to reference this chain. 5826 5826 for (RenderObject* curr = newActiveElement->renderer(); curr; curr = curr->parent()) { 5827 if (!curr->node() || !curr->node()->isElementNode() || curr->isTextOr BR())5827 if (!curr->node() || !curr->node()->isElementNode() || curr->isTextOrLineBreak()) 5828 5828 continue; 5829 5829 m_userActionElements.setInActiveChain(toElement(curr->node()), true); -
trunk/Source/WebCore/dom/Position.cpp
r155957 r156038 58 58 if (renderer.isText() && toRenderText(renderer).firstTextBox()) 59 59 return true; 60 if (renderer.is BR() && toRenderBR(renderer).inlineBoxWrapper())60 if (renderer.isLineBreak() && toRenderBR(renderer).inlineBoxWrapper()) 61 61 return true; 62 62 return false; … … 858 858 if (o->nonPseudoNode()) { 859 859 if ((o->isText() && boundingBoxLogicalHeight(o, toRenderText(o)->linesBoundingBox())) 860 || (o->is BR() && boundingBoxLogicalHeight(o, toRenderBR(o)->linesBoundingBox()))860 || (o->isLineBreak() && boundingBoxLogicalHeight(o, toRenderBR(o)->linesBoundingBox())) 861 861 || (o->isBox() && toRenderBox(o)->pixelSnappedLogicalHeight()) 862 862 || (o->isRenderInline() && isEmptyInline(o) && boundingBoxLogicalHeight(o, toRenderInline(o)->linesBoundingBox()))) -
trunk/Source/WebCore/editing/Editor.cpp
r155975 r156038 3086 3086 if (!node->renderer()) 3087 3087 return 0; 3088 if (node->renderer()->isTextOr BR())3088 if (node->renderer()->isTextOrLineBreak()) 3089 3089 return node; 3090 3090 if (isHTMLTextFormControlElement(node)) -
trunk/Source/WebCore/editing/TextIterator.cpp
r155975 r156038 216 216 { 217 217 RenderObject* renderer = node->renderer(); 218 if (!renderer || renderer->isTextOr BR())218 if (!renderer || renderer->isTextOrLineBreak()) 219 219 return false; 220 220 return renderer->style()->hasOutOfFlowPosition(); -
trunk/Source/WebCore/html/HTMLElement.cpp
r155970 r156038 50 50 #include "HTMLTextFormControlElement.h" 51 51 #include "NodeTraversal.h" 52 #include "Render WordBreak.h"52 #include "RenderBR.h" 53 53 #include "ScriptController.h" 54 54 #include "ScriptEventListener.h" … … 792 792 { 793 793 if (hasLocalName(wbrTag)) 794 return new (arena) Render WordBreak(this);794 return new (arena) RenderBR(this); 795 795 return RenderObject::createObject(*this, style); 796 796 } -
trunk/Source/WebCore/rendering/InlineBox.cpp
r156025 r156038 142 142 return virtualLogicalHeight(); 143 143 144 if (renderer().isTextOr BR())144 if (renderer().isTextOrLineBreak()) 145 145 return behavesLikeText() ? renderer().style(isFirstLineStyle())->fontMetrics().height() : 0; 146 146 if (renderer().isBox() && parent()) … … 158 158 int InlineBox::baselinePosition(FontBaseline baselineType) const 159 159 { 160 if (renderer().is BR() && !behavesLikeText())160 if (renderer().isLineBreak() && !behavesLikeText()) 161 161 return 0; 162 162 return boxModelObject()->baselinePosition(baselineType, m_bitfields.firstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); … … 165 165 LayoutUnit InlineBox::lineHeight() const 166 166 { 167 if (renderer().is BR() && !behavesLikeText())167 if (renderer().isLineBreak() && !behavesLikeText()) 168 168 return 0; 169 169 return boxModelObject()->lineHeight(m_bitfields.firstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); … … 192 192 if (m_renderer.isBox()) 193 193 toRenderBox(renderer()).setInlineBoxWrapper(0); 194 else if (renderer().is BR())194 else if (renderer().isLineBreak()) 195 195 toRenderBR(renderer()).setInlineBoxWrapper(0); 196 196 } … … 203 203 if (m_renderer.isBox()) 204 204 toRenderBox(renderer()).setInlineBoxWrapper(0); 205 else if (renderer().is BR())205 else if (renderer().isLineBreak()) 206 206 toRenderBR(renderer()).setInlineBoxWrapper(0); 207 207 } … … 212 212 if (m_renderer.isBox()) 213 213 toRenderBox(renderer()).setInlineBoxWrapper(this); 214 else if (renderer().is BR())214 else if (renderer().isLineBreak()) 215 215 toRenderBR(renderer()).setInlineBoxWrapper(this); 216 216 } … … 258 258 // specification.) 259 259 LayoutPoint childPoint = accumulatedOffset; 260 if (parent()->renderer().style()->isFlippedBlocksWritingMode() && !renderer().is BR()) // Faster than calling containingBlock().260 if (parent()->renderer().style()->isFlippedBlocksWritingMode() && !renderer().isLineBreak()) // Faster than calling containingBlock(). 261 261 childPoint = m_renderer.containingBlock()->flipForWritingModeForChild(&toRenderBox(renderer()), childPoint); 262 262 -
trunk/Source/WebCore/rendering/InlineBox.h
r156025 r156038 70 70 virtual void attachLine(); 71 71 72 virtual bool isLineBreak() const { return renderer().is BR(); }72 virtual bool isLineBreak() const { return renderer().isLineBreak(); } 73 73 74 74 virtual void adjustPosition(float dx, float dy); -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r156025 r156038 128 128 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; 129 129 else if (child->behavesLikeText()) { 130 if (child->renderer().is BR() || child->renderer().parent() != &renderer()) {130 if (child->renderer().isLineBreak() || child->renderer().parent() != &renderer()) { 131 131 if (!parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle->font().fontMetrics()) 132 132 || parentStyle->lineHeight() != childStyle->lineHeight() … … 137 137 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; 138 138 } else { 139 if (child->renderer().is BR()) {139 if (child->renderer().isLineBreak()) { 140 140 // FIXME: This is dumb. We only turn off because current layout test results expect the <br> to be 0-height on the baseline. 141 141 // Other than making a zillion tests have to regenerate results, there's no reason to ditch the optimization here. 142 shouldClearDescendantsHaveSameLineHeightAndBaseline = true;142 shouldClearDescendantsHaveSameLineHeightAndBaseline = child->renderer().isBR(); 143 143 } else { 144 144 ASSERT(isInlineFlowBox()); … … 167 167 if (box.hasRenderOverflow() || box.hasSelfPaintingLayer()) 168 168 child->clearKnownToHaveNoOverflow(); 169 } else if (!child->renderer().is BR() && (child->renderer().style(isFirstLineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer()169 } else if (!child->renderer().isLineBreak() && (child->renderer().style(isFirstLineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer() 170 170 || (child->renderer().isListMarker() && !toRenderListMarker(child->renderer()).isInside()) 171 171 || child->renderer().style(isFirstLineStyle())->hasBorderImageOutsets())) … … 951 951 continue; // Positioned placeholders don't affect calculations. 952 952 953 if (curr->renderer().is BR())953 if (curr->renderer().isLineBreak()) 954 954 continue; 955 955 if (curr->renderer().isText()) { -
trunk/Source/WebCore/rendering/InlineIterator.h
r155975 r156038 77 77 { 78 78 return m_obj && m_obj->preservesNewline() && m_obj->isText() && toRenderText(m_obj)->textLength() 79 && !toRenderText(m_obj)->isWordBreak() &&toRenderText(m_obj)->characterAt(m_pos) == '\n';79 && toRenderText(m_obj)->characterAt(m_pos) == '\n'; 80 80 } 81 81 … … 167 167 { 168 168 ASSERT(object); // The iterator will of course return 0, but its not an expected argument to this function. 169 return object->isText OrBR() || object->isFloating() || object->isOutOfFlowPositioned() || object->isReplaced();169 return object->isText() || object->isLineBreak() || object->isFloating() || object->isOutOfFlowPositioned() || object->isReplaced(); 170 170 } 171 171 -
trunk/Source/WebCore/rendering/RenderBR.cpp
r155962 r156038 24 24 25 25 #include "Document.h" 26 #include "HTMLElement.h" 26 27 #include "RenderBlock.h" 27 28 #include "RootInlineBox.h" … … 32 33 static const int invalidLineHeight = -1; 33 34 34 RenderBR::RenderBR( Element* element)35 RenderBR::RenderBR(HTMLElement* element) 35 36 : RenderBoxModelObject(element) 36 37 , m_inlineBoxWrapper(nullptr) 37 38 , m_cachedLineHeight(invalidLineHeight) 39 , m_isWBR(element && element->hasTagName(HTMLNames::wbrTag)) 38 40 { 39 setIs BR();41 setIsLineBreak(); 40 42 } 41 43 -
trunk/Source/WebCore/rendering/RenderBR.h
r155962 r156038 27 27 namespace WebCore { 28 28 29 class HTMLElement; 29 30 class Position; 30 31 32 // FIXME: Rename this to RenderLineBreak. 31 33 class RenderBR FINAL : public RenderBoxModelObject { 32 34 public: 33 explicit RenderBR( Element*);35 explicit RenderBR(HTMLElement*); 34 36 virtual ~RenderBR(); 35 37 36 38 static RenderBR* createAnonymous(Document&); 37 39 38 virtual const char* renderName() const { return "RenderBR"; }40 virtual const char* renderName() const { return m_isWBR ? "RenderWordBreak" : "RenderBR"; } 39 41 40 42 InlineBox* createInlineBox(); … … 51 53 52 54 private: 55 void node() const WTF_DELETED_FUNCTION; 56 57 virtual bool isWBR() const OVERRIDE { return m_isWBR; } 58 53 59 virtual VisiblePosition positionForPoint(const LayoutPoint&) OVERRIDE; 54 60 virtual int caretMinOffset() const OVERRIDE; … … 80 86 InlineBox* m_inlineBoxWrapper; 81 87 mutable int m_cachedLineHeight; 88 bool m_isWBR; 82 89 }; 83 90 84 91 inline RenderBR& toRenderBR(RenderObject& object) 85 92 { 86 ASSERT_WITH_SECURITY_IMPLICATION(object.is BR());93 ASSERT_WITH_SECURITY_IMPLICATION(object.isLineBreak()); 87 94 return static_cast<RenderBR&>(object); 88 95 } … … 90 97 inline const RenderBR& toRenderBR(const RenderObject& object) 91 98 { 92 ASSERT_WITH_SECURITY_IMPLICATION(object.is BR());99 ASSERT_WITH_SECURITY_IMPLICATION(object.isLineBreak()); 93 100 return static_cast<const RenderBR&>(object); 94 101 } … … 96 103 inline RenderBR* toRenderBR(RenderObject* object) 97 104 { 98 ASSERT_WITH_SECURITY_IMPLICATION(object->is BR());105 ASSERT_WITH_SECURITY_IMPLICATION(object->isLineBreak()); 99 106 return static_cast<RenderBR*>(object); 100 107 } … … 102 109 inline const RenderBR* toRenderBR(const RenderObject* object) 103 110 { 104 ASSERT_WITH_SECURITY_IMPLICATION(object->is BR());111 ASSERT_WITH_SECURITY_IMPLICATION(object->isLineBreak()); 105 112 return static_cast<const RenderBR*>(object); 106 113 } -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r156022 r156038 5107 5107 break; 5108 5108 5109 if (!result->isOutOfFlowPositioned() && (result->isTextOr BR() || result->isFloating() || result->isReplaced() || result->isRenderInline()))5109 if (!result->isOutOfFlowPositioned() && (result->isTextOrLineBreak() || result->isFloating() || result->isReplaced() || result->isRenderInline())) 5110 5110 break; 5111 5111 … … 5256 5256 5257 5257 if (!child->isText()) { 5258 if (child->isLineBreakOpportunity()) { 5259 updatePreferredWidth(minLogicalWidth, inlineMin); 5260 inlineMin = 0; 5261 continue; 5262 } 5258 5263 // Case (1) and (2). Inline replaced and inline flow elements. 5259 5264 if (child->isRenderInline()) { … … 5352 5357 // Case (3). Text. 5353 5358 RenderText* t = toRenderText(child); 5354 5355 if (t->isWordBreak()) {5356 updatePreferredWidth(minLogicalWidth, inlineMin);5357 inlineMin = 0;5358 continue;5359 }5360 5359 5361 5360 if (t->style()->hasTextCombine() && t->isCombineText()) -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r156025 r156038 271 271 return toRenderBox(obj)->createInlineBox(); 272 272 273 if (obj->is BR()) {273 if (obj->isLineBreak()) { 274 274 InlineBox* inlineBox = toRenderBR(obj)->createInlineBox(); 275 275 // We only treat a box as text for a <br> if we are on a line by ourself or in strict mode 276 276 // (Note the use of strict mode. In "almost strict" mode, we don't treat the box for <br> as text.) 277 inlineBox->setBehavesLikeText(isOnlyRun || obj->document().inNoQuirksMode() );277 inlineBox->setBehavesLikeText(isOnlyRun || obj->document().inNoQuirksMode() || obj->isLineBreakOpportunity()); 278 278 return inlineBox; 279 279 } … … 297 297 updateCounterIfNeeded(renderText); 298 298 renderText->dirtyLineBoxes(fullLayout); 299 } else if (o->is BR())299 } else if (o->isLineBreak()) 300 300 toRenderBR(o)->dirtyLineBoxes(fullLayout); 301 301 else … … 929 929 else if (r->m_object->isBox()) 930 930 toRenderBox(r->m_object)->positionLineBox(r->m_box); 931 else if (r->m_object->is BR())931 else if (r->m_object->isLineBreak()) 932 932 toRenderBR(r->m_object)->replaceInlineBoxWrapper(r->m_box); 933 933 } … … 1843 1843 o->layoutIfNeeded(); 1844 1844 } 1845 } else if (o->isTextOr BR() || (o->isRenderInline() && !walker.atEndOfInline())) {1845 } else if (o->isTextOrLineBreak() || (o->isRenderInline() && !walker.atEndOfInline())) { 1846 1846 if (o->isRenderInline()) 1847 1847 toRenderInline(o)->updateAlwaysCreateLineBoxes(layoutState.isFullLayout()); … … 2547 2547 ASSERT(next->isText()); 2548 2548 RenderText* nextText = toRenderText(next); 2549 if (nextText->isWordBreak())2550 return true;2551 2549 if (!nextText->textLength()) 2552 2550 return false; … … 2568 2566 if (autoWrap && currentCharacterIsSpace) 2569 2567 return true; 2568 2569 if (next && next->isLineBreakOpportunity()) 2570 return autoWrap; 2570 2571 2571 2572 bool nextIsText = (next && (current.m_obj->isText() || isEmptyInline(current.m_obj)) && next->isText() && (autoWrap || next->style()->autoWrap())); … … 2877 2878 } 2878 2879 #endif 2879 2880 if (t->isWordBreak()) {2881 commitLineBreakAtCurrentWidth(width, lBreak, current.m_obj);2882 ASSERT(current.m_pos == t->textLength());2883 }2884 2880 2885 2881 if (renderTextInfo.m_text != t) { … … 3157 3153 goto end; 3158 3154 } 3159 } else 3155 } else if (current.m_obj->isLineBreakOpportunity()) 3156 commitLineBreakAtCurrentWidth(width, lBreak, current.m_obj); 3157 else 3160 3158 ASSERT_NOT_REACHED(); 3161 3159 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r155957 r156038 607 607 yield(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth())); 608 608 } 609 } else if (curr->is BR()) {609 } else if (curr->isLineBreak()) { 610 610 if (InlineBox* inlineBox = toRenderBR(curr)->inlineBoxWrapper()) { 611 611 // FIXME: This could use a helper to share these with text path. … … 908 908 if (curr->isBox()) 909 909 return toRenderBox(curr)->inlineBoxWrapper(); 910 if (curr->is BR()) {910 if (curr->isLineBreak()) { 911 911 RenderBR* renderBR = toRenderBR(curr); 912 912 if (renderBR->inlineBoxWrapper()) … … 936 936 if (curr->isBox()) 937 937 return toRenderBox(curr)->inlineBoxWrapper(); 938 if (curr->is BR()) {938 if (curr->isLineBreak()) { 939 939 RenderBR* renderBR = toRenderBR(curr); 940 940 if (renderBR->inlineBoxWrapper()) … … 1315 1315 for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox()) 1316 1316 childText->root().markDirty(); 1317 } else if (curr->is BR()) {1317 } else if (curr->isLineBreak()) { 1318 1318 RenderBR* currBR = toRenderBR(curr); 1319 1319 if (currBR->inlineBoxWrapper()) -
trunk/Source/WebCore/rendering/RenderLineBoxList.cpp
r155957 r156038 343 343 if (wrapper) 344 344 box = &wrapper->root(); 345 } if (curr->is BR()) {345 } if (curr->isLineBreak()) { 346 346 InlineBox* wrapper = toRenderBR(curr)->inlineBoxWrapper(); 347 347 if (wrapper) -
trunk/Source/WebCore/rendering/RenderObject.h
r155975 r156038 569 569 570 570 bool isText() const { return !m_bitfields.isBox() && m_bitfields.isTextOrRenderView(); } 571 bool isBR() const { return m_bitfields.isBR(); } 572 bool isTextOrBR() const { return isText() || isBR(); } 571 bool isLineBreak() const { return m_bitfields.isLineBreak(); } 572 bool isBR() const { return isLineBreak() && !isWBR(); } 573 bool isLineBreakOpportunity() const { return isLineBreak() && isWBR(); } 574 bool isTextOrLineBreak() const { return isText() || isLineBreak(); } 573 575 bool isBox() const { return m_bitfields.isBox(); } 574 576 bool isRenderView() const { return m_bitfields.isBox() && m_bitfields.isTextOrRenderView(); } … … 703 705 704 706 void setIsText() { ASSERT(!isBox()); m_bitfields.setIsTextOrRenderView(true); } 705 void setIs BR() { m_bitfields.setIsBR(true); }707 void setIsLineBreak() { m_bitfields.setIsLineBreak(true); } 706 708 void setIsBox() { m_bitfields.setIsBox(true); } 707 709 void setIsRenderView() { ASSERT(isBox()); m_bitfields.setIsTextOrRenderView(true); } … … 1050 1052 1051 1053 Node* generatingPseudoHostElement() const; 1054 1055 virtual bool isWBR() const { ASSERT_NOT_REACHED(); return false; } 1052 1056 1053 1057 #if ENABLE(CSS_SHAPES) … … 1103 1107 , m_isInline(true) 1104 1108 , m_isReplaced(false) 1105 , m_is BR(false)1109 , m_isLineBreak(false) 1106 1110 , m_horizontalWritingMode(true) 1107 1111 , m_isDragging(false) … … 1135 1139 ADD_BOOLEAN_BITFIELD(isInline, IsInline); 1136 1140 ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced); 1137 ADD_BOOLEAN_BITFIELD(is BR, IsBR);1141 ADD_BOOLEAN_BITFIELD(isLineBreak, IsLineBreak); 1138 1142 ADD_BOOLEAN_BITFIELD(horizontalWritingMode, HorizontalWritingMode); 1139 1143 ADD_BOOLEAN_BITFIELD(isDragging, IsDragging); -
trunk/Source/WebCore/rendering/RenderObjectChildList.cpp
r155957 r156038 77 77 if (oldChild->isBox()) 78 78 toRenderBox(oldChild)->deleteLineBoxWrapper(); 79 else if (oldChild->is BR())79 else if (oldChild->isLineBreak()) 80 80 toRenderBR(oldChild)->deleteInlineBoxWrapper(); 81 81 -
trunk/Source/WebCore/rendering/RenderText.cpp
r156025 r156038 186 186 187 187 bool RenderText::isTextFragment() const 188 {189 return false;190 }191 192 bool RenderText::isWordBreak() const193 188 { 194 189 return false; -
trunk/Source/WebCore/rendering/RenderText.h
r155496 r156038 41 41 42 42 virtual bool isTextFragment() const; 43 virtual bool isWordBreak() const;44 43 45 44 virtual PassRefPtr<StringImpl> originalText() const; -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r155975 r156038 309 309 } 310 310 311 if (!o.isBoxModelObject() || o.is BR())311 if (!o.isBoxModelObject() || o.isLineBreak()) 312 312 return; 313 313 -
trunk/Source/WebCore/rendering/RenderingAllInOne.cpp
r155631 r156038 119 119 #include "RenderView.cpp" 120 120 #include "RenderWidget.cpp" 121 #include "RenderWordBreak.cpp"122 121 #include "RootInlineBox.cpp" 123 122 #include "ScrollBehavior.cpp" -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r156025 r156038 916 916 LayoutUnit ascentWithMargin = box->renderer().style(isFirstLineStyle())->fontMetrics().ascent(baselineType()); 917 917 LayoutUnit descentWithMargin = box->renderer().style(isFirstLineStyle())->fontMetrics().descent(baselineType()); 918 if (box->parent() && !box->renderer().isTextOr BR()) {918 if (box->parent() && !box->renderer().isTextOrLineBreak()) { 919 919 ascentWithMargin += box->boxModelObject()->borderAndPaddingBefore() + box->boxModelObject()->marginBefore(); 920 920 descentWithMargin += box->boxModelObject()->borderAndPaddingAfter() + box->boxModelObject()->marginAfter(); … … 930 930 LayoutUnit RootInlineBox::verticalPositionForBox(InlineBox* box, VerticalPositionCache& verticalPositionCache) 931 931 { 932 if (box->renderer().isTextOr BR())932 if (box->renderer().isTextOrLineBreak()) 933 933 return box->parent()->logicalTop(); 934 934 … … 1002 1002 bool RootInlineBox::includeLeadingForBox(InlineBox* box) const 1003 1003 { 1004 if (box->renderer().isReplaced() || (box->renderer().isTextOr BR() && !box->behavesLikeText()))1004 if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText())) 1005 1005 return false; 1006 1006 … … 1011 1011 bool RootInlineBox::includeFontForBox(InlineBox* box) const 1012 1012 { 1013 if (box->renderer().isReplaced() || (box->renderer().isTextOr BR() && !box->behavesLikeText()))1013 if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText())) 1014 1014 return false; 1015 1015 … … 1024 1024 bool RootInlineBox::includeGlyphsForBox(InlineBox* box) const 1025 1025 { 1026 if (box->renderer().isReplaced() || (box->renderer().isTextOr BR() && !box->behavesLikeText()))1026 if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText())) 1027 1027 return false; 1028 1028 … … 1037 1037 bool RootInlineBox::includeMarginForBox(InlineBox* box) const 1038 1038 { 1039 if (box->renderer().isReplaced() || (box->renderer().isTextOr BR() && !box->behavesLikeText()))1039 if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText())) 1040 1040 return false; 1041 1041
Note:
See TracChangeset
for help on using the changeset viewer.