Changeset 156038 in webkit


Ignore:
Timestamp:
Sep 18, 2013, 7:33:55 AM (11 years ago)
Author:
Antti Koivisto
Message:

Remove RenderWordBreak
https://bugs.webkit.org/show_bug.cgi?id=121549

Reviewed by Andreas Kling.

Remove RenderWordBreak and make it a bit in RenderBR instead.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.vcxproj/WebCore.vcxproj:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Document.cpp:

(WebCore::Document::updateHoverActiveState):

  • dom/Position.cpp:

(WebCore::hasInlineBoxWrapper):
(WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):

  • editing/Editor.cpp:

(WebCore::findFirstMarkable):

  • editing/TextIterator.cpp:

(WebCore::ignoresContainerClip):

  • html/HTMLElement.cpp:

(WebCore::HTMLElement::createRenderer):

  • rendering/InlineBox.cpp:

(WebCore::InlineBox::logicalHeight):
(WebCore::InlineBox::baselinePosition):
(WebCore::InlineBox::lineHeight):
(WebCore::InlineBox::deleteLine):
(WebCore::InlineBox::extractLine):
(WebCore::InlineBox::attachLine):
(WebCore::InlineBox::nodeAtPoint):

  • rendering/InlineBox.h:

(WebCore::InlineBox::isLineBreak):

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::computeOverflow):

  • rendering/InlineIterator.h:

(WebCore::InlineIterator::atTextParagraphSeparator):
(WebCore::isIteratorTarget):

  • rendering/RenderBR.cpp:

(WebCore::RenderBR::RenderBR):

  • rendering/RenderBR.h:

(WebCore::toRenderBR):

RenderBR now represents both hard and soft line breaks. It will be renamed to RenderLineBreak later.

  • rendering/RenderBlock.cpp:

(WebCore::InlineMinMaxIterator::next):
(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::createInlineBoxForRenderer):
(WebCore::dirtyLineBoxesForRenderer):
(WebCore::RenderBlock::computeBlockDirectionPositionsForLine):
(WebCore::RenderBlockFlow::layoutInlineChildren):
(WebCore::textBeginsWithBreakablePosition):
(WebCore::canBreakAtThisPosition):
(WebCore::RenderBlock::LineBreaker::nextSegmentBreak):

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::generateCulledLineBoxRects):
(WebCore::RenderInline::culledInlineFirstLineBox):
(WebCore::RenderInline::culledInlineLastLineBox):
(WebCore::RenderInline::dirtyLineBoxes):

  • rendering/RenderLineBoxList.cpp:

(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):

  • rendering/RenderObject.h:

(WebCore::RenderObject::isLineBreak):

This bit covers both BR and WBR.

(WebCore::RenderObject::isBR):
(WebCore::RenderObject::isLineBreakOpportunity):

Rename isWordBreak to isLineBreakOpportunity. This matches HTML5 spec terminology.

(WebCore::RenderObject::isTextOrLineBreak):

Since WBR used to be Text we want this check to still cover it too. Renamed from isTextOrBR.

(WebCore::RenderObject::setIsLineBreak):
(WebCore::RenderObject::isWBR):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):

  • rendering/RenderObjectChildList.cpp:

(WebCore::RenderObjectChildList::removeChildNode):

  • rendering/RenderText.cpp:
  • rendering/RenderText.h:
  • rendering/RenderTreeAsText.cpp:

(WebCore::RenderTreeAsText::writeRenderObject):

  • rendering/RenderWordBreak.cpp: Removed.
  • rendering/RenderWordBreak.h: Removed.
  • rendering/RenderingAllInOne.cpp:
  • rendering/RootInlineBox.cpp:

(WebCore::RootInlineBox::ascentAndDescentForBox):
(WebCore::RootInlineBox::verticalPositionForBox):
(WebCore::RootInlineBox::includeLeadingForBox):
(WebCore::RootInlineBox::includeFontForBox):
(WebCore::RootInlineBox::includeGlyphsForBox):
(WebCore::RootInlineBox::includeMarginForBox):

Location:
trunk/Source/WebCore
Files:
2 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r155992 r156038  
    22002200    rendering/RenderView.cpp
    22012201    rendering/RenderWidget.cpp
    2202     rendering/RenderWordBreak.cpp
    22032202    rendering/RootInlineBox.cpp
    22042203    rendering/ScrollBehavior.cpp
  • trunk/Source/WebCore/ChangeLog

    r156037 r156038  
     12013-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
    11012013-09-18  Csaba Osztrogonác  <ossy@webkit.org>
    2102
  • trunk/Source/WebCore/GNUmakefile.list.am

    r155992 r156038  
    45554555        Source/WebCore/rendering/RenderWidget.cpp \
    45564556        Source/WebCore/rendering/RenderWidget.h \
    4557         Source/WebCore/rendering/RenderWordBreak.cpp \
    4558         Source/WebCore/rendering/RenderWordBreak.h \
    45594557        Source/WebCore/rendering/RootInlineBox.cpp \
    45604558        Source/WebCore/rendering/RootInlineBox.h \
  • trunk/Source/WebCore/Target.pri

    r156006 r156038  
    12261226    rendering/RenderView.cpp \
    12271227    rendering/RenderWidget.cpp \
    1228     rendering/RenderWordBreak.cpp \
    12291228    rendering/RootInlineBox.cpp \
    12301229    rendering/ScrollBehavior.cpp \
     
    24942493    rendering/RenderView.h \
    24952494    rendering/RenderWidget.h \
    2496     rendering/RenderWordBreak.h \
    24972495    rendering/RootInlineBox.h \
    24982496    rendering/ScrollBehavior.h \
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r155797 r156038  
    1097110971    </ClCompile>
    1097210972    <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">
    1098710973      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    1098810974      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     
    2007920065    <ClInclude Include="..\rendering\RenderView.h" />
    2008020066    <ClInclude Include="..\rendering\RenderWidget.h" />
    20081     <ClInclude Include="..\rendering\RenderWordBreak.h" />
    2008220067    <ClInclude Include="..\rendering\RootInlineBox.h" />
    2008320068    <ClInclude Include="..\rendering\ScrollBehavior.h" />
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r155992 r156038  
    143143                076306E117E16089005A7C4E /* JSSourceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 076306DF17E16089005A7C4E /* JSSourceInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
    144144                076306E317E22A43005A7C4E /* MediaStreamTrackSourcesRequestClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 076306E217E22A43005A7C4E /* MediaStreamTrackSourcesRequestClient.h */; };
    145                 076306E717E251EC005A7C4E /* JSMediaStreamTrackSourcesCallbackCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 076306E617E251EC005A7C4E /* JSMediaStreamTrackSourcesCallbackCustom.h */; };
    146145                076970861463AD8700F502CF /* TextTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076970841463AD8700F502CF /* TextTrackList.cpp */; };
    147146                076970871463AD8700F502CF /* TextTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = 076970851463AD8700F502CF /* TextTrackList.h */; };
     
    29592958                9370918D1416D86B00477333 /* textAreaResizeCorner@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */; };
    29602959                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 */; };
    29632960                9380F47309A11AB4001FDB34 /* Widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9380F47109A11AB4001FDB34 /* Widget.cpp */; };
    29642961                9380F47409A11AB4001FDB34 /* Widget.h in Headers */ = {isa = PBXBuildFile; fileRef = 9380F47209A11AB4001FDB34 /* Widget.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    65786575                076306DF17E16089005A7C4E /* JSSourceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSourceInfo.h; sourceTree = "<group>"; };
    65796576                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>"; };
    65816577                076970841463AD8700F502CF /* TextTrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackList.cpp; sourceTree = "<group>"; };
    65826578                076970851463AD8700F502CF /* TextTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackList.h; sourceTree = "<group>"; };
     
    95129508                9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "textAreaResizeCorner@2x.png"; sourceTree = "<group>"; };
    95139509                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>"; };
    95169510                9380F47109A11AB4001FDB34 /* Widget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Widget.cpp; sourceTree = "<group>"; };
    95179511                9380F47209A11AB4001FDB34 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Widget.h; sourceTree = "<group>"; };
     
    2058720581                                A871DFE10A15376B00B12A68 /* RenderWidget.cpp */,
    2058820582                                A871DFE00A15376B00B12A68 /* RenderWidget.h */,
    20589                                 93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */,
    20590                                 93799EF70BF2743600D0F230 /* RenderWordBreak.h */,
    2059120583                                A8CFF5E00A155A05000A4234 /* RootInlineBox.cpp */,
    2059220584                                A8CFF5DA0A155A05000A4234 /* RootInlineBox.h */,
     
    2372623718                                BCEA4868097D93020094C9E4 /* RenderView.h in Headers */,
    2372723719                                A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */,
    23728                                 93799EF90BF2743600D0F230 /* RenderWordBreak.h in Headers */,
    2372923720                                078E094717D16E1C00420AA1 /* RTCVoidRequest.h in Headers */,
    2373023721                                A89CCC530F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h in Headers */,
     
    2689326884                                BCEA4867097D93020094C9E4 /* RenderView.cpp in Sources */,
    2689426885                                A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */,
    26895                                 93799EF80BF2743600D0F230 /* RenderWordBreak.cpp in Sources */,
    2689626886                                A89CCC520F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp in Sources */,
    2689726887                                93309E09099E64920056E581 /* ReplaceSelectionCommand.cpp in Sources */,
  • trunk/Source/WebCore/dom/Document.cpp

    r155975 r156038  
    58255825            // will need to reference this chain.
    58265826            for (RenderObject* curr = newActiveElement->renderer(); curr; curr = curr->parent()) {
    5827                 if (!curr->node() || !curr->node()->isElementNode() || curr->isTextOrBR())
     5827                if (!curr->node() || !curr->node()->isElementNode() || curr->isTextOrLineBreak())
    58285828                    continue;
    58295829                m_userActionElements.setInActiveChain(toElement(curr->node()), true);
  • trunk/Source/WebCore/dom/Position.cpp

    r155957 r156038  
    5858    if (renderer.isText() && toRenderText(renderer).firstTextBox())
    5959        return true;
    60     if (renderer.isBR() && toRenderBR(renderer).inlineBoxWrapper())
     60    if (renderer.isLineBreak() && toRenderBR(renderer).inlineBoxWrapper())
    6161        return true;
    6262    return false;
     
    858858        if (o->nonPseudoNode()) {
    859859            if ((o->isText() && boundingBoxLogicalHeight(o, toRenderText(o)->linesBoundingBox()))
    860                 || (o->isBR() && boundingBoxLogicalHeight(o, toRenderBR(o)->linesBoundingBox()))
     860                || (o->isLineBreak() && boundingBoxLogicalHeight(o, toRenderBR(o)->linesBoundingBox()))
    861861                || (o->isBox() && toRenderBox(o)->pixelSnappedLogicalHeight())
    862862                || (o->isRenderInline() && isEmptyInline(o) && boundingBoxLogicalHeight(o, toRenderInline(o)->linesBoundingBox())))
  • trunk/Source/WebCore/editing/Editor.cpp

    r155975 r156038  
    30863086        if (!node->renderer())
    30873087            return 0;
    3088         if (node->renderer()->isTextOrBR())
     3088        if (node->renderer()->isTextOrLineBreak())
    30893089            return node;
    30903090        if (isHTMLTextFormControlElement(node))
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r155975 r156038  
    216216{
    217217    RenderObject* renderer = node->renderer();
    218     if (!renderer || renderer->isTextOrBR())
     218    if (!renderer || renderer->isTextOrLineBreak())
    219219        return false;
    220220    return renderer->style()->hasOutOfFlowPosition();
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r155970 r156038  
    5050#include "HTMLTextFormControlElement.h"
    5151#include "NodeTraversal.h"
    52 #include "RenderWordBreak.h"
     52#include "RenderBR.h"
    5353#include "ScriptController.h"
    5454#include "ScriptEventListener.h"
     
    792792{
    793793    if (hasLocalName(wbrTag))
    794         return new (arena) RenderWordBreak(this);
     794        return new (arena) RenderBR(this);
    795795    return RenderObject::createObject(*this, style);
    796796}
  • trunk/Source/WebCore/rendering/InlineBox.cpp

    r156025 r156038  
    142142        return virtualLogicalHeight();
    143143   
    144     if (renderer().isTextOrBR())
     144    if (renderer().isTextOrLineBreak())
    145145        return behavesLikeText() ? renderer().style(isFirstLineStyle())->fontMetrics().height() : 0;
    146146    if (renderer().isBox() && parent())
     
    158158int InlineBox::baselinePosition(FontBaseline baselineType) const
    159159{
    160     if (renderer().isBR() && !behavesLikeText())
     160    if (renderer().isLineBreak() && !behavesLikeText())
    161161        return 0;
    162162    return boxModelObject()->baselinePosition(baselineType, m_bitfields.firstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine);
     
    165165LayoutUnit InlineBox::lineHeight() const
    166166{
    167     if (renderer().isBR() && !behavesLikeText())
     167    if (renderer().isLineBreak() && !behavesLikeText())
    168168        return 0;
    169169    return boxModelObject()->lineHeight(m_bitfields.firstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine);
     
    192192        if (m_renderer.isBox())
    193193            toRenderBox(renderer()).setInlineBoxWrapper(0);
    194         else if (renderer().isBR())
     194        else if (renderer().isLineBreak())
    195195            toRenderBR(renderer()).setInlineBoxWrapper(0);
    196196    }
     
    203203    if (m_renderer.isBox())
    204204        toRenderBox(renderer()).setInlineBoxWrapper(0);
    205     else if (renderer().isBR())
     205    else if (renderer().isLineBreak())
    206206        toRenderBR(renderer()).setInlineBoxWrapper(0);
    207207}
     
    212212    if (m_renderer.isBox())
    213213        toRenderBox(renderer()).setInlineBoxWrapper(this);
    214     else if (renderer().isBR())
     214    else if (renderer().isLineBreak())
    215215        toRenderBR(renderer()).setInlineBoxWrapper(this);
    216216}
     
    258258    // specification.)
    259259    LayoutPoint childPoint = accumulatedOffset;
    260     if (parent()->renderer().style()->isFlippedBlocksWritingMode() && !renderer().isBR()) // Faster than calling containingBlock().
     260    if (parent()->renderer().style()->isFlippedBlocksWritingMode() && !renderer().isLineBreak()) // Faster than calling containingBlock().
    261261        childPoint = m_renderer.containingBlock()->flipForWritingModeForChild(&toRenderBox(renderer()), childPoint);
    262262   
  • trunk/Source/WebCore/rendering/InlineBox.h

    r156025 r156038  
    7070    virtual void attachLine();
    7171
    72     virtual bool isLineBreak() const { return renderer().isBR(); }
     72    virtual bool isLineBreak() const { return renderer().isLineBreak(); }
    7373
    7474    virtual void adjustPosition(float dx, float dy);
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r156025 r156038  
    128128            shouldClearDescendantsHaveSameLineHeightAndBaseline = true;
    129129        else if (child->behavesLikeText()) {
    130             if (child->renderer().isBR() || child->renderer().parent() != &renderer()) {
     130            if (child->renderer().isLineBreak() || child->renderer().parent() != &renderer()) {
    131131                if (!parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle->font().fontMetrics())
    132132                    || parentStyle->lineHeight() != childStyle->lineHeight()
     
    137137                shouldClearDescendantsHaveSameLineHeightAndBaseline = true;
    138138        } else {
    139             if (child->renderer().isBR()) {
     139            if (child->renderer().isLineBreak()) {
    140140                // FIXME: This is dumb. We only turn off because current layout test results expect the <br> to be 0-height on the baseline.
    141141                // 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();
    143143            } else {
    144144                ASSERT(isInlineFlowBox());
     
    167167            if (box.hasRenderOverflow() || box.hasSelfPaintingLayer())
    168168                child->clearKnownToHaveNoOverflow();
    169         } else if (!child->renderer().isBR() && (child->renderer().style(isFirstLineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer()
     169        } else if (!child->renderer().isLineBreak() && (child->renderer().style(isFirstLineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer()
    170170                   || (child->renderer().isListMarker() && !toRenderListMarker(child->renderer()).isInside())
    171171                   || child->renderer().style(isFirstLineStyle())->hasBorderImageOutsets()))
     
    951951            continue; // Positioned placeholders don't affect calculations.
    952952
    953         if (curr->renderer().isBR())
     953        if (curr->renderer().isLineBreak())
    954954            continue;
    955955        if (curr->renderer().isText()) {
  • trunk/Source/WebCore/rendering/InlineIterator.h

    r155975 r156038  
    7777    {
    7878        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';
    8080    }
    8181   
     
    167167{
    168168    ASSERT(object); // The iterator will of course return 0, but its not an expected argument to this function.
    169     return object->isTextOrBR() || object->isFloating() || object->isOutOfFlowPositioned() || object->isReplaced();
     169    return object->isText() || object->isLineBreak() || object->isFloating() || object->isOutOfFlowPositioned() || object->isReplaced();
    170170}
    171171
  • trunk/Source/WebCore/rendering/RenderBR.cpp

    r155962 r156038  
    2424
    2525#include "Document.h"
     26#include "HTMLElement.h"
    2627#include "RenderBlock.h"
    2728#include "RootInlineBox.h"
     
    3233static const int invalidLineHeight = -1;
    3334
    34 RenderBR::RenderBR(Element* element)
     35RenderBR::RenderBR(HTMLElement* element)
    3536    : RenderBoxModelObject(element)
    3637    , m_inlineBoxWrapper(nullptr)
    3738    , m_cachedLineHeight(invalidLineHeight)
     39    , m_isWBR(element && element->hasTagName(HTMLNames::wbrTag))
    3840{
    39     setIsBR();
     41    setIsLineBreak();
    4042}
    4143
  • trunk/Source/WebCore/rendering/RenderBR.h

    r155962 r156038  
    2727namespace WebCore {
    2828
     29class HTMLElement;
    2930class Position;
    3031
     32// FIXME: Rename this to RenderLineBreak.
    3133class RenderBR FINAL : public RenderBoxModelObject {
    3234public:
    33     explicit RenderBR(Element*);
     35    explicit RenderBR(HTMLElement*);
    3436    virtual ~RenderBR();
    3537
    3638    static RenderBR* createAnonymous(Document&);
    3739
    38     virtual const char* renderName() const { return "RenderBR"; }
     40    virtual const char* renderName() const { return m_isWBR ? "RenderWordBreak" : "RenderBR"; }
    3941
    4042    InlineBox* createInlineBox();
     
    5153
    5254private:
     55    void node() const WTF_DELETED_FUNCTION;
     56
     57    virtual bool isWBR() const OVERRIDE { return m_isWBR; }
     58
    5359    virtual VisiblePosition positionForPoint(const LayoutPoint&) OVERRIDE;
    5460    virtual int caretMinOffset() const OVERRIDE;
     
    8086    InlineBox* m_inlineBoxWrapper;
    8187    mutable int m_cachedLineHeight;
     88    bool m_isWBR;
    8289};
    8390
    8491inline RenderBR& toRenderBR(RenderObject& object)
    8592{
    86     ASSERT_WITH_SECURITY_IMPLICATION(object.isBR());
     93    ASSERT_WITH_SECURITY_IMPLICATION(object.isLineBreak());
    8794    return static_cast<RenderBR&>(object);
    8895}
     
    9097inline const RenderBR& toRenderBR(const RenderObject& object)
    9198{
    92     ASSERT_WITH_SECURITY_IMPLICATION(object.isBR());
     99    ASSERT_WITH_SECURITY_IMPLICATION(object.isLineBreak());
    93100    return static_cast<const RenderBR&>(object);
    94101}
     
    96103inline RenderBR* toRenderBR(RenderObject* object)
    97104{
    98     ASSERT_WITH_SECURITY_IMPLICATION(object->isBR());
     105    ASSERT_WITH_SECURITY_IMPLICATION(object->isLineBreak());
    99106    return static_cast<RenderBR*>(object);
    100107}
     
    102109inline const RenderBR* toRenderBR(const RenderObject* object)
    103110{
    104     ASSERT_WITH_SECURITY_IMPLICATION(object->isBR());
     111    ASSERT_WITH_SECURITY_IMPLICATION(object->isLineBreak());
    105112    return static_cast<const RenderBR*>(object);
    106113}
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r156022 r156038  
    51075107            break;
    51085108
    5109         if (!result->isOutOfFlowPositioned() && (result->isTextOrBR() || result->isFloating() || result->isReplaced() || result->isRenderInline()))
     5109        if (!result->isOutOfFlowPositioned() && (result->isTextOrLineBreak() || result->isFloating() || result->isReplaced() || result->isRenderInline()))
    51105110             break;
    51115111       
     
    52565256
    52575257            if (!child->isText()) {
     5258                if (child->isLineBreakOpportunity()) {
     5259                    updatePreferredWidth(minLogicalWidth, inlineMin);
     5260                    inlineMin = 0;
     5261                    continue;
     5262                }
    52585263                // Case (1) and (2).  Inline replaced and inline flow elements.
    52595264                if (child->isRenderInline()) {
     
    53525357                // Case (3). Text.
    53535358                RenderText* t = toRenderText(child);
    5354 
    5355                 if (t->isWordBreak()) {
    5356                     updatePreferredWidth(minLogicalWidth, inlineMin);
    5357                     inlineMin = 0;
    5358                     continue;
    5359                 }
    53605359
    53615360                if (t->style()->hasTextCombine() && t->isCombineText())
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r156025 r156038  
    271271        return toRenderBox(obj)->createInlineBox();
    272272
    273     if (obj->isBR()) {
     273    if (obj->isLineBreak()) {
    274274        InlineBox* inlineBox = toRenderBR(obj)->createInlineBox();
    275275        // We only treat a box as text for a <br> if we are on a line by ourself or in strict mode
    276276        // (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());
    278278        return inlineBox;
    279279    }
     
    297297        updateCounterIfNeeded(renderText);
    298298        renderText->dirtyLineBoxes(fullLayout);
    299     } else if (o->isBR())
     299    } else if (o->isLineBreak())
    300300        toRenderBR(o)->dirtyLineBoxes(fullLayout);
    301301    else
     
    929929        else if (r->m_object->isBox())
    930930            toRenderBox(r->m_object)->positionLineBox(r->m_box);
    931         else if (r->m_object->isBR())
     931        else if (r->m_object->isLineBreak())
    932932            toRenderBR(r->m_object)->replaceInlineBoxWrapper(r->m_box);
    933933    }
     
    18431843                        o->layoutIfNeeded();
    18441844                }
    1845             } else if (o->isTextOrBR() || (o->isRenderInline() && !walker.atEndOfInline())) {
     1845            } else if (o->isTextOrLineBreak() || (o->isRenderInline() && !walker.atEndOfInline())) {
    18461846                if (o->isRenderInline())
    18471847                    toRenderInline(o)->updateAlwaysCreateLineBoxes(layoutState.isFullLayout());
     
    25472547    ASSERT(next->isText());
    25482548    RenderText* nextText = toRenderText(next);
    2549     if (nextText->isWordBreak())
    2550         return true;
    25512549    if (!nextText->textLength())
    25522550        return false;
     
    25682566    if (autoWrap && currentCharacterIsSpace)
    25692567        return true;
     2568
     2569    if (next && next->isLineBreakOpportunity())
     2570        return autoWrap;
    25702571
    25712572    bool nextIsText = (next && (current.m_obj->isText() || isEmptyInline(current.m_obj)) && next->isText() && (autoWrap || next->style()->autoWrap()));
     
    28772878            }
    28782879#endif
    2879 
    2880             if (t->isWordBreak()) {
    2881                 commitLineBreakAtCurrentWidth(width, lBreak, current.m_obj);
    2882                 ASSERT(current.m_pos == t->textLength());
    2883             }
    28842880
    28852881            if (renderTextInfo.m_text != t) {
     
    31573153                    goto end;
    31583154            }
    3159         } else
     3155        } else if (current.m_obj->isLineBreakOpportunity())
     3156            commitLineBreakAtCurrentWidth(width, lBreak, current.m_obj);
     3157        else
    31603158            ASSERT_NOT_REACHED();
    31613159
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r155957 r156038  
    607607                    yield(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth()));
    608608            }
    609         } else if (curr->isBR()) {
     609        } else if (curr->isLineBreak()) {
    610610            if (InlineBox* inlineBox = toRenderBR(curr)->inlineBoxWrapper()) {
    611611                // FIXME: This could use a helper to share these with text path.
     
    908908        if (curr->isBox())
    909909            return toRenderBox(curr)->inlineBoxWrapper();
    910         if (curr->isBR()) {
     910        if (curr->isLineBreak()) {
    911911            RenderBR* renderBR = toRenderBR(curr);
    912912            if (renderBR->inlineBoxWrapper())
     
    936936        if (curr->isBox())
    937937            return toRenderBox(curr)->inlineBoxWrapper();
    938         if (curr->isBR()) {
     938        if (curr->isLineBreak()) {
    939939            RenderBR* renderBR = toRenderBR(curr);
    940940            if (renderBR->inlineBoxWrapper())
     
    13151315                    for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox())
    13161316                        childText->root().markDirty();
    1317                 } else if (curr->isBR()) {
     1317                } else if (curr->isLineBreak()) {
    13181318                    RenderBR* currBR = toRenderBR(curr);
    13191319                    if (currBR->inlineBoxWrapper())
  • trunk/Source/WebCore/rendering/RenderLineBoxList.cpp

    r155957 r156038  
    343343            if (wrapper)
    344344                box = &wrapper->root();
    345         } if (curr->isBR()) {
     345        } if (curr->isLineBreak()) {
    346346            InlineBox* wrapper = toRenderBR(curr)->inlineBoxWrapper();
    347347            if (wrapper)
  • trunk/Source/WebCore/rendering/RenderObject.h

    r155975 r156038  
    569569
    570570    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(); }
    573575    bool isBox() const { return m_bitfields.isBox(); }
    574576    bool isRenderView() const  { return m_bitfields.isBox() && m_bitfields.isTextOrRenderView(); }
     
    703705
    704706    void setIsText() { ASSERT(!isBox()); m_bitfields.setIsTextOrRenderView(true); }
    705     void setIsBR() { m_bitfields.setIsBR(true); }
     707    void setIsLineBreak() { m_bitfields.setIsLineBreak(true); }
    706708    void setIsBox() { m_bitfields.setIsBox(true); }
    707709    void setIsRenderView() { ASSERT(isBox()); m_bitfields.setIsTextOrRenderView(true); }
     
    10501052
    10511053    Node* generatingPseudoHostElement() const;
     1054
     1055    virtual bool isWBR() const { ASSERT_NOT_REACHED(); return false; }
    10521056
    10531057#if ENABLE(CSS_SHAPES)
     
    11031107            , m_isInline(true)
    11041108            , m_isReplaced(false)
    1105             , m_isBR(false)
     1109            , m_isLineBreak(false)
    11061110            , m_horizontalWritingMode(true)
    11071111            , m_isDragging(false)
     
    11351139        ADD_BOOLEAN_BITFIELD(isInline, IsInline);
    11361140        ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced);
    1137         ADD_BOOLEAN_BITFIELD(isBR, IsBR);
     1141        ADD_BOOLEAN_BITFIELD(isLineBreak, IsLineBreak);
    11381142        ADD_BOOLEAN_BITFIELD(horizontalWritingMode, HorizontalWritingMode);
    11391143        ADD_BOOLEAN_BITFIELD(isDragging, IsDragging);
  • trunk/Source/WebCore/rendering/RenderObjectChildList.cpp

    r155957 r156038  
    7777    if (oldChild->isBox())
    7878        toRenderBox(oldChild)->deleteLineBoxWrapper();
    79     else if (oldChild->isBR())
     79    else if (oldChild->isLineBreak())
    8080        toRenderBR(oldChild)->deleteInlineBoxWrapper();
    8181
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r156025 r156038  
    186186
    187187bool RenderText::isTextFragment() const
    188 {
    189     return false;
    190 }
    191 
    192 bool RenderText::isWordBreak() const
    193188{
    194189    return false;
  • trunk/Source/WebCore/rendering/RenderText.h

    r155496 r156038  
    4141
    4242    virtual bool isTextFragment() const;
    43     virtual bool isWordBreak() const;
    4443
    4544    virtual PassRefPtr<StringImpl> originalText() const;
  • trunk/Source/WebCore/rendering/RenderTreeAsText.cpp

    r155975 r156038  
    309309        }
    310310
    311         if (!o.isBoxModelObject() || o.isBR())
     311        if (!o.isBoxModelObject() || o.isLineBreak())
    312312            return;
    313313
  • trunk/Source/WebCore/rendering/RenderingAllInOne.cpp

    r155631 r156038  
    119119#include "RenderView.cpp"
    120120#include "RenderWidget.cpp"
    121 #include "RenderWordBreak.cpp"
    122121#include "RootInlineBox.cpp"
    123122#include "ScrollBehavior.cpp"
  • trunk/Source/WebCore/rendering/RootInlineBox.cpp

    r156025 r156038  
    916916        LayoutUnit ascentWithMargin = box->renderer().style(isFirstLineStyle())->fontMetrics().ascent(baselineType());
    917917        LayoutUnit descentWithMargin = box->renderer().style(isFirstLineStyle())->fontMetrics().descent(baselineType());
    918         if (box->parent() && !box->renderer().isTextOrBR()) {
     918        if (box->parent() && !box->renderer().isTextOrLineBreak()) {
    919919            ascentWithMargin += box->boxModelObject()->borderAndPaddingBefore() + box->boxModelObject()->marginBefore();
    920920            descentWithMargin += box->boxModelObject()->borderAndPaddingAfter() + box->boxModelObject()->marginAfter();
     
    930930LayoutUnit RootInlineBox::verticalPositionForBox(InlineBox* box, VerticalPositionCache& verticalPositionCache)
    931931{
    932     if (box->renderer().isTextOrBR())
     932    if (box->renderer().isTextOrLineBreak())
    933933        return box->parent()->logicalTop();
    934934   
     
    10021002bool RootInlineBox::includeLeadingForBox(InlineBox* box) const
    10031003{
    1004     if (box->renderer().isReplaced() || (box->renderer().isTextOrBR() && !box->behavesLikeText()))
     1004    if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText()))
    10051005        return false;
    10061006
     
    10111011bool RootInlineBox::includeFontForBox(InlineBox* box) const
    10121012{
    1013     if (box->renderer().isReplaced() || (box->renderer().isTextOrBR() && !box->behavesLikeText()))
     1013    if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText()))
    10141014        return false;
    10151015   
     
    10241024bool RootInlineBox::includeGlyphsForBox(InlineBox* box) const
    10251025{
    1026     if (box->renderer().isReplaced() || (box->renderer().isTextOrBR() && !box->behavesLikeText()))
     1026    if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText()))
    10271027        return false;
    10281028   
     
    10371037bool RootInlineBox::includeMarginForBox(InlineBox* box) const
    10381038{
    1039     if (box->renderer().isReplaced() || (box->renderer().isTextOrBR() && !box->behavesLikeText()))
     1039    if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText()))
    10401040        return false;
    10411041
Note: See TracChangeset for help on using the changeset viewer.