Commit 620bb2ee authored by hyatt@apple.com's avatar hyatt@apple.com

Add new RenderBlockFlow class

https://bugs.webkit.org/show_bug.cgi?id=120777

Reviewed by Simon Fraser.

This patch adds a new RenderBlockFlow class. The idea is to get all of the line/float/margin
code out of RenderBlock and into the subclass, and then we can make RenderBlock an abstract
base. This will save memory for all of the classes that derive from RenderBlock but have
their own layout systems (e.g., flexbox, grid, table), and it will let us tighten up
types to make it more clear when we're talking about block layout code vs. a more generic
block-level object that can have any kind of layout.

The only real change here is that isBlockFlow() has been renamed to isRenderBlockFlow() and
is now checking if the object is a RenderBlockFlow. All of the block subclasses have been patched
to be a RenderBlock or RenderBlockFlow.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* dom/Position.cpp:
(WebCore::Position::isCandidate):
(WebCore::Position::getInlineBoxAndOffset):
(WebCore::Position::primaryDirection):
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
* editing/Editor.cpp:
(WebCore::Editor::baseWritingDirectionForSelectionStart):
* editing/FrameSelection.cpp:
(WebCore::caretRenderer):
* editing/TextIterator.cpp:
(WebCore::TextIterator::shouldRepresentNodeOffsetZero):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::makeEditableRootEmpty):
* editing/htmlediting.cpp:
(WebCore::isBlockFlowElement):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderThumb::RenderSliderThumb):
* html/shadow/SliderThumbElement.h:
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock):
(WebCore::RenderBlock::collapseMargins):
(WebCore::RenderBlock::selectionGaps):
(WebCore::RenderBlock::firstLineBoxBaseline):
(WebCore::RenderBlock::lastLineBoxBaseline):
(WebCore::RenderBlock::firstLineBlock):
(WebCore::findFirstLetterBlock):
(WebCore::shouldCheckLines):
(WebCore::RenderBlock::adjustForBorderFit):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp: Added.
(WebCore::RenderBlockFlow::RenderBlockFlow):
(WebCore::RenderBlockFlow::~RenderBlockFlow):
* rendering/RenderBlockFlow.h: Added.
(WebCore::toRenderBlockFlow):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):
(WebCore::RenderBox::positionForPoint):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::canHaveBoxInfoInRegion):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::RenderDetailsMarker):
* rendering/RenderDetailsMarker.h:
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::RenderFieldset):
* rendering/RenderFieldset.h:
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::RenderFileUploadControl):
* rendering/RenderFileUploadControl.h:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
* rendering/RenderFlowThread.h:
* rendering/RenderFullScreen.cpp:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::computeRectForRepaint):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
* rendering/RenderMeter.cpp:
(WebCore::RenderMeter::RenderMeter):
* rendering/RenderMeter.h:
* rendering/RenderMultiColumnBlock.cpp:
(WebCore::RenderMultiColumnBlock::RenderMultiColumnBlock):
* rendering/RenderMultiColumnBlock.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeRectForRepaint):
(WebCore::RenderObject::styleWillChange):
(WebCore::firstLineStyleForCachedUncachedType):
* rendering/RenderObject.h:
(WebCore::RenderObject::isBR):
(WebCore::RenderObject::isRenderBlockFlow):
* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::insertChildNode):
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::RenderProgress):
* rendering/RenderProgress.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::RenderRegion):
* rendering/RenderRegion.h:
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsBlock::RenderRubyAsBlock):
* rendering/RenderRuby.h:
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::RenderRubyBase):
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::RenderRubyRun):
* rendering/RenderRubyRun.h:
* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::RenderRubyText):
* rendering/RenderRubyText.h:
* rendering/RenderTableCaption.cpp:
(WebCore::RenderTableCaption::RenderTableCaption):
* rendering/RenderTableCaption.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::RenderTableCell):
* rendering/RenderTableCell.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::RenderTextControl):
* rendering/RenderTextControl.h:
* rendering/RenderTextControlSingleLine.h:
(WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
* rendering/RenderTextTrackCue.cpp:
(WebCore::RenderTextTrackCue::RenderTextTrackCue):
* rendering/RenderTextTrackCue.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
* rendering/RenderView.h:
* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::RenderSVGBlock):
* rendering/svg/RenderSVGBlock.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b4e37ade
......@@ -2111,6 +2111,7 @@ set(WebCore_SOURCES
rendering/RenderArena.cpp
rendering/RenderBR.cpp
rendering/RenderBlock.cpp
rendering/RenderBlockFlow.cpp
rendering/RenderBlockLineLayout.cpp
rendering/RenderBox.cpp
rendering/RenderBoxModelObject.cpp
......
2013-09-05 David Hyatt <hyatt@apple.com>
Add new RenderBlockFlow class
https://bugs.webkit.org/show_bug.cgi?id=120777
Reviewed by Simon Fraser.
This patch adds a new RenderBlockFlow class. The idea is to get all of the line/float/margin
code out of RenderBlock and into the subclass, and then we can make RenderBlock an abstract
base. This will save memory for all of the classes that derive from RenderBlock but have
their own layout systems (e.g., flexbox, grid, table), and it will let us tighten up
types to make it more clear when we're talking about block layout code vs. a more generic
block-level object that can have any kind of layout.
The only real change here is that isBlockFlow() has been renamed to isRenderBlockFlow() and
is now checking if the object is a RenderBlockFlow. All of the block subclasses have been patched
to be a RenderBlock or RenderBlockFlow.
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* dom/Position.cpp:
(WebCore::Position::isCandidate):
(WebCore::Position::getInlineBoxAndOffset):
(WebCore::Position::primaryDirection):
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
* editing/Editor.cpp:
(WebCore::Editor::baseWritingDirectionForSelectionStart):
* editing/FrameSelection.cpp:
(WebCore::caretRenderer):
* editing/TextIterator.cpp:
(WebCore::TextIterator::shouldRepresentNodeOffsetZero):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::makeEditableRootEmpty):
* editing/htmlediting.cpp:
(WebCore::isBlockFlowElement):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderThumb::RenderSliderThumb):
* html/shadow/SliderThumbElement.h:
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock):
(WebCore::RenderBlock::collapseMargins):
(WebCore::RenderBlock::selectionGaps):
(WebCore::RenderBlock::firstLineBoxBaseline):
(WebCore::RenderBlock::lastLineBoxBaseline):
(WebCore::RenderBlock::firstLineBlock):
(WebCore::findFirstLetterBlock):
(WebCore::shouldCheckLines):
(WebCore::RenderBlock::adjustForBorderFit):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp: Added.
(WebCore::RenderBlockFlow::RenderBlockFlow):
(WebCore::RenderBlockFlow::~RenderBlockFlow):
* rendering/RenderBlockFlow.h: Added.
(WebCore::toRenderBlockFlow):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):
(WebCore::RenderBox::positionForPoint):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::canHaveBoxInfoInRegion):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::RenderDetailsMarker):
* rendering/RenderDetailsMarker.h:
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::RenderFieldset):
* rendering/RenderFieldset.h:
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::RenderFileUploadControl):
* rendering/RenderFileUploadControl.h:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
* rendering/RenderFlowThread.h:
* rendering/RenderFullScreen.cpp:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::computeRectForRepaint):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
* rendering/RenderMeter.cpp:
(WebCore::RenderMeter::RenderMeter):
* rendering/RenderMeter.h:
* rendering/RenderMultiColumnBlock.cpp:
(WebCore::RenderMultiColumnBlock::RenderMultiColumnBlock):
* rendering/RenderMultiColumnBlock.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeRectForRepaint):
(WebCore::RenderObject::styleWillChange):
(WebCore::firstLineStyleForCachedUncachedType):
* rendering/RenderObject.h:
(WebCore::RenderObject::isBR):
(WebCore::RenderObject::isRenderBlockFlow):
* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::insertChildNode):
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::RenderProgress):
* rendering/RenderProgress.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::RenderRegion):
* rendering/RenderRegion.h:
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsBlock::RenderRubyAsBlock):
* rendering/RenderRuby.h:
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::RenderRubyBase):
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::RenderRubyRun):
* rendering/RenderRubyRun.h:
* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::RenderRubyText):
* rendering/RenderRubyText.h:
* rendering/RenderTableCaption.cpp:
(WebCore::RenderTableCaption::RenderTableCaption):
* rendering/RenderTableCaption.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::RenderTableCell):
* rendering/RenderTableCell.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::RenderTextControl):
* rendering/RenderTextControl.h:
* rendering/RenderTextControlSingleLine.h:
(WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
* rendering/RenderTextTrackCue.cpp:
(WebCore::RenderTextTrackCue::RenderTextTrackCue):
* rendering/RenderTextTrackCue.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
* rendering/RenderView.h:
* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::RenderSVGBlock):
* rendering/svg/RenderSVGBlock.h:
2013-09-05 Tim Horton <timothy_horton@apple.com>
iOS build broke with change to make Mac use PDFKit for PDFDocumentImage
......@@ -4374,6 +4374,8 @@ webcore_sources += \
Source/WebCore/rendering/RenderArena.h \
Source/WebCore/rendering/RenderBlock.cpp \
Source/WebCore/rendering/RenderBlock.h \
Source/WebCore/rendering/RenderBlockFlow.cpp \
Source/WebCore/rendering/RenderBlockFlow.h \
Source/WebCore/rendering/RenderBlockLineLayout.cpp \
Source/WebCore/rendering/RenderBox.cpp \
Source/WebCore/rendering/RenderBox.h \
......
......@@ -1155,6 +1155,7 @@ SOURCES += \
rendering/RenderApplet.cpp \
rendering/RenderArena.cpp \
rendering/RenderBlock.cpp \
rendering/RenderBlockFlow.cpp \
rendering/RenderBlockLineLayout.cpp \
rendering/RenderBox.cpp \
rendering/RenderBoxModelObject.cpp \
......
......@@ -9683,6 +9683,20 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\rendering\RenderBlockFlow.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\rendering\RenderBlockLineLayout.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
......@@ -4709,6 +4709,8 @@
BC0B358814C4F9830055E22A /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0B358614C4F9830055E22A /* RunLoop.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC0B36A40CD3C67C00AC7EB5 /* Console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0B36A10CD3C67C00AC7EB5 /* Console.cpp */; };
BC0B36A50CD3C67C00AC7EB5 /* Console.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0B36A20CD3C67C00AC7EB5 /* Console.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC10D76717D8EE6E005E2626 /* RenderBlockFlow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCFB45F417D8E49400444446 /* RenderBlockFlow.cpp */; };
BC10D76817D8EE71005E2626 /* RenderBlockFlow.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFB45F317D8E39200444446 /* RenderBlockFlow.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC124EE70C2641CD009E2349 /* BarProp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC124EE40C2641CD009E2349 /* BarProp.cpp */; };
BC124EE80C2641CD009E2349 /* BarProp.h in Headers */ = {isa = PBXBuildFile; fileRef = BC124EE50C2641CD009E2349 /* BarProp.h */; };
BC124EFF0C26447A009E2349 /* JSBarProp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC124EFD0C26447A009E2349 /* JSBarProp.cpp */; };
......@@ -12018,6 +12020,8 @@
BCFB2E5D0979E46400BA703D /* CachedResourceClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedResourceClient.h; sourceTree = "<group>"; };
BCFB2F74097A2E1A00BA703D /* Arena.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Arena.cpp; sourceTree = "<group>"; };
BCFB2F75097A2E1A00BA703D /* Arena.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Arena.h; sourceTree = "<group>"; };
BCFB45F317D8E39200444446 /* RenderBlockFlow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderBlockFlow.h; sourceTree = "<group>"; };
BCFB45F417D8E49400444446 /* RenderBlockFlow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderBlockFlow.cpp; sourceTree = "<group>"; };
BCFE2F0F0C1B58370020235F /* JSRect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSRect.cpp; sourceTree = "<group>"; };
BCFE2F100C1B58370020235F /* JSRect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSRect.h; sourceTree = "<group>"; };
BCFF648F0EAD15C200C1D6F7 /* LengthBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LengthBox.h; sourceTree = "<group>"; };
......@@ -20391,6 +20395,8 @@
BCEA481F097D93020094C9E4 /* RenderArena.h */,
BCEA4820097D93020094C9E4 /* RenderBlock.cpp */,
BCEA4821097D93020094C9E4 /* RenderBlock.h */,
BCFB45F417D8E49400444446 /* RenderBlockFlow.cpp */,
BCFB45F317D8E39200444446 /* RenderBlockFlow.h */,
BCEA4813097D93020094C9E4 /* RenderBlockLineLayout.cpp */,
BCEA4822097D93020094C9E4 /* RenderBox.cpp */,
BCEA4823097D93020094C9E4 /* RenderBox.h */,
......@@ -24545,6 +24551,7 @@
FBB0C5B817BBD629003D3677 /* CSSFilterImageValue.h in Headers */,
BE16C59317CFE17200852C04 /* InbandGenericTextTrack.h in Headers */,
BE16C59517CFE17200852C04 /* InbandWebVTTTextTrack.h in Headers */,
BC10D76817D8EE71005E2626 /* RenderBlockFlow.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -27568,6 +27575,7 @@
FBB0C5B717BBD626003D3677 /* CSSFilterImageValue.cpp in Sources */,
BE16C59217CFE17200852C04 /* InbandGenericTextTrack.cpp in Sources */,
BE16C59417CFE17200852C04 /* InbandWebVTTTextTrack.cpp in Sources */,
BC10D76717D8EE6E005E2626 /* RenderBlockFlow.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1225,7 +1225,7 @@ bool AccessibilityRenderObject::computeAccessibilityIsIgnored() const
if (node && node->hasTagName(spanTag))
return true;
if (m_renderer->isBlockFlow() && m_renderer->childrenInline() && !canSetFocusAttribute())
if (m_renderer->isRenderBlockFlow() && m_renderer->childrenInline() && !canSetFocusAttribute())
return !toRenderBlock(m_renderer)->firstLineBox() && !mouseButtonListener();
// ignore images seemingly used as spacers
......@@ -2562,7 +2562,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
if (node && node->hasTagName(footerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
return FooterRole;
if (m_renderer->isBlockFlow())
if (m_renderer->isRenderBlockFlow())
return GroupRole;
// If the element does not have role, but it has ARIA attributes, accessibility should fallback to exposing it as a group.
......
......@@ -925,7 +925,7 @@ bool Position::isCandidate() const
if (m_anchorNode->hasTagName(htmlTag))
return false;
if (renderer->isBlockFlow()) {
if (renderer->isRenderBlockFlow()) {
if (toRenderBlock(renderer)->logicalHeight() || m_anchorNode->hasTagName(bodyTag)) {
if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer))
return atFirstEditingPositionForNode() && !Position::nodeIsUserSelectNone(deprecatedNode());
......@@ -1185,7 +1185,7 @@ void Position::getInlineBoxAndOffset(EAffinity affinity, TextDirection primaryDi
if (!renderer->isText()) {
inlineBox = 0;
if (canHaveChildrenForEditing(deprecatedNode()) && renderer->isBlockFlow() && hasRenderedNonAnonymousDescendantsWithHeight(renderer)) {
if (canHaveChildrenForEditing(deprecatedNode()) && renderer->isRenderBlockFlow() && hasRenderedNonAnonymousDescendantsWithHeight(renderer)) {
// Try a visually equivalent position with possibly opposite editability. This helps in case |this| is in
// an editable block but surrounded by non-editable positions. It acts to negate the logic at the beginning
// of RenderObject::createVisiblePosition().
......@@ -1333,7 +1333,7 @@ TextDirection Position::primaryDirection() const
{
TextDirection primaryDirection = LTR;
for (const RenderObject* r = m_anchorNode->renderer(); r; r = r->parent()) {
if (r->isBlockFlow()) {
if (r->isRenderBlockFlow()) {
primaryDirection = r->style()->direction();
break;
}
......
......@@ -159,7 +159,7 @@ bool PositionIterator::isCandidate() const
if (isTableElement(m_anchorNode) || editingIgnoresContent(m_anchorNode))
return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsUserSelectNone(m_anchorNode->parentNode());
if (!m_anchorNode->hasTagName(htmlTag) && renderer->isBlockFlow()) {
if (!m_anchorNode->hasTagName(htmlTag) && renderer->isRenderBlockFlow()) {
if (toRenderBlock(renderer)->logicalHeight() || m_anchorNode->hasTagName(bodyTag)) {
if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer))
return atStartOfNode() && !Position::nodeIsUserSelectNone(m_anchorNode);
......
......@@ -1013,7 +1013,7 @@ void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, EditingStyle* sty
// Since addInlineStyleIfNeeded can't add styles to block-flow render objects, add style attribute instead.
// FIXME: applyInlineStyleToRange should be used here instead.
if ((node->renderer()->isBlockFlow() || node->childNodeCount()) && node->isHTMLElement()) {
if ((node->renderer()->isRenderBlockFlow() || node->childNodeCount()) && node->isHTMLElement()) {
setNodeAttribute(toHTMLElement(node), styleAttr, newInlineStyle->style()->asText());
return;
}
......
......@@ -874,7 +874,7 @@ PassRefPtr<Node> CompositeEditCommand::addBlockPlaceholderIfNeeded(Element* cont
document().updateLayoutIgnorePendingStylesheets();
RenderObject* renderer = container->renderer();
if (!renderer || !renderer->isBlockFlow())
if (!renderer || !renderer->isRenderBlockFlow())
return 0;
// append the placeholder to make sure it follows
......
......@@ -1425,7 +1425,7 @@ WritingDirection Editor::baseWritingDirectionForSelectionStart() const
if (!renderer)
return result;
if (!renderer->isBlockFlow()) {
if (!renderer->isRenderBlockFlow()) {
renderer = renderer->containingBlock();
if (!renderer)
return result;
......
......@@ -1271,7 +1271,7 @@ static RenderObject* caretRenderer(Node* node)
return 0;
// if caretNode is a block and caret is inside it then caret should be painted by that block
bool paintedByBlock = renderer->isBlockFlow() && caretRendersInsideNode(node);
bool paintedByBlock = renderer->isRenderBlockFlow() && caretRendersInsideNode(node);
return paintedByBlock ? renderer : renderer->containingBlock();
}
......
......@@ -918,7 +918,7 @@ bool TextIterator::shouldRepresentNodeOffsetZero()
// Additionally, if the range we are iterating over contains huge sections of unrendered content,
// we would create VisiblePositions on every call to this function without this check.
if (!m_node->renderer() || m_node->renderer()->style()->visibility() != VISIBLE
|| (m_node->renderer()->isBlockFlow() && !toRenderBlock(m_node->renderer())->height() && !m_node->hasTagName(bodyTag)))
|| (m_node->renderer()->isRenderBlockFlow() && !toRenderBlock(m_node->renderer())->height() && !m_node->hasTagName(bodyTag)))
return false;
// The startPos.isNotNull() check is needed because the start could be before the body,
......
......@@ -404,7 +404,7 @@ bool TypingCommand::makeEditableRootEmpty()
if (root->firstChild() == root->lastChild() && root->firstElementChild() && root->firstElementChild()->hasTagName(brTag)) {
// If there is a single child and it could be a placeholder, leave it alone.
if (root->renderer() && root->renderer()->isBlockFlow())
if (root->renderer() && root->renderer()->isRenderBlockFlow())
return false;
}
......
......@@ -1290,7 +1290,7 @@ bool isBlockFlowElement(const Node* node)
if (!node->isElementNode())
return false;
RenderObject* renderer = node->renderer();
return renderer && renderer->isBlockFlow();
return renderer && renderer->isRenderBlockFlow();
}
Element* deprecatedEnclosingBlockFlowElement(Node* node)
......
......@@ -95,7 +95,7 @@ HTMLElement* sliderTrackElementOf(Node* node)
// --------------------------------
RenderSliderThumb::RenderSliderThumb(SliderThumbElement* element)
: RenderBlock(element)
: RenderBlockFlow(element)
{
}
......
......@@ -34,7 +34,7 @@
#include "HTMLDivElement.h"
#include "HTMLNames.h"
#include "RenderBlock.h"
#include "RenderBlockFlow.h"
#include <wtf/Forward.h>
namespace WebCore {
......@@ -96,7 +96,7 @@ HTMLElement* sliderTrackElementOf(Node*);
// --------------------------------
class RenderSliderThumb FINAL : public RenderBlock {
class RenderSliderThumb FINAL : public RenderBlockFlow {
public:
RenderSliderThumb(SliderThumbElement*);
void updateAppearance(RenderStyle* parentStyle);
......
......@@ -131,7 +131,7 @@ LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSiz
computeLineGridPaginationOrigin(renderer);
// If we have a new grid to track, then add it to our set.
if (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isBlockFlow())
if (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isRenderBlockFlow())
establishLineGrid(toRenderBlock(renderer));
// FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
......
......@@ -1720,7 +1720,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
if (oldHeight > newHeight && maxFloatLogicalBottom > newHeight && !childrenInline()) {
// One of our children's floats may have become an overhanging float for us. We need to look for it.
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (child->isBlockFlow() && !child->isFloatingOrOutOfFlowPositioned()) {
if (child->isRenderBlockFlow() && !child->isFloatingOrOutOfFlowPositioned()) {
RenderBlock* block = toRenderBlock(child);
if (block->lowestFloatLogicalBottom() + block->logicalTop() > newHeight)
addOverhangingFloats(block, false);
......@@ -2258,7 +2258,7 @@ LayoutUnit RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo
LayoutUnit oldLogicalHeight = logicalHeight();
setLogicalHeight(logicalTop);
RenderObject* prev = child->previousSibling();
if (prev && prev->isBlockFlow() && !prev->isFloatingOrOutOfFlowPositioned()) {
if (prev && prev->isRenderBlockFlow() && !prev->isFloatingOrOutOfFlowPositioned()) {
RenderBlock* block = toRenderBlock(prev);
if (block->containsFloats() && !block->avoidsFloats() && (block->logicalTop() + block->lowestFloatLogicalBottom()) > logicalTop)
addOverhangingFloats(block, false);
......@@ -3683,7 +3683,7 @@ GapRects RenderBlock::selectionGaps(RenderBlock* rootBlock, const LayoutPoint& r
// FIXME: overflow: auto/scroll regions need more math here, since painting in the border box is different from painting in the padding box (one is scrolled, the other is
// fixed).
GapRects result;
if (!isBlockFlow()) // FIXME: Make multi-column selection gap filling work someday.
if (!isRenderBlockFlow()) // FIXME: Make multi-column selection gap filling work someday.
return result;
if (hasColumns() || hasTransform() || style()->columnSpan()) {
......@@ -6762,7 +6762,7 @@ int RenderBlock::baselinePosition(FontBaseline baselineType, bool firstLine, Lin
int RenderBlock::firstLineBoxBaseline() const
{
if (!isBlockFlow() || (isWritingModeRoot() && !isRubyRun()))
if (!isRenderBlockFlow() || (isWritingModeRoot() && !isRubyRun()))
return -1;
if (childrenInline()) {
......@@ -6791,7 +6791,7 @@ int RenderBlock::inlineBlockBaseline(LineDirectionMode direction) const
int RenderBlock::lastLineBoxBaseline(LineDirectionMode lineDirection) const
{
if (!isBlockFlow() || (isWritingModeRoot() && !isRubyRun()))
if (!isRenderBlockFlow() || (isWritingModeRoot() && !isRubyRun()))
return -1;
if (childrenInline()) {
......@@ -6852,7 +6852,7 @@ RenderBlock* RenderBlock::firstLineBlock() const
// FIXME: Remove when buttons are implemented with align-items instead
// of flexbox.
if (firstLineBlock->isReplaced() || firstLineBlock->isFloating()
|| !parentBlock || parentBlock->firstChild() != firstLineBlock || !parentBlock->isBlockFlow()
|| !parentBlock || parentBlock->firstChild() != firstLineBlock || !parentBlock->isRenderBlockFlow()
|| (parentBlock->isFlexibleBox() && !parentBlock->isRenderButton()))
break;
ASSERT_WITH_SECURITY_IMPLICATION(parentBlock->isRenderBlock());
......@@ -6911,7 +6911,7 @@ static inline RenderObject* findFirstLetterBlock(RenderBlock* start)
RenderObject* parentBlock = firstLetterBlock->parent();
if (firstLetterBlock->isReplaced() || !parentBlock || parentBlock->firstChild() != firstLetterBlock ||
!parentBlock->isBlockFlow() || (parentBlock->isFlexibleBox() && !parentBlock->isRenderButton()))
!parentBlock->isRenderBlockFlow() || (parentBlock->isFlexibleBox() && !parentBlock->isRenderButton()))
return 0;
firstLetterBlock = parentBlock;
}
......@@ -7093,7 +7093,7 @@ void RenderBlock::updateFirstLetter()
static bool shouldCheckLines(RenderObject* obj)
{
return !obj->isFloatingOrOutOfFlowPositioned() && !obj->isRunIn()
&& obj->isBlockFlow() && obj->style()->height().isAuto()
&& obj->isRenderBlockFlow() && obj->style()->height().isAuto()
&& (!obj->isDeprecatedFlexibleBox() || obj->style()->boxOrient() == VERTICAL);
}
......@@ -7198,7 +7198,7 @@ void RenderBlock::adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit&
else {
for (RenderBox* obj = firstChildBox(); obj; obj = obj->nextSiblingBox()) {
if (!obj->isFloatingOrOutOfFlowPositioned()) {
if (obj->isBlockFlow() && !obj->hasOverflowClip())
if (obj->isRenderBlockFlow() && !obj->hasOverflowClip())
toRenderBlock(obj)->adjustForBorderFit(x + obj->x(), left, right);
else if (obj->style()->visibility() == VISIBLE) {
// We are a replaced element or some kind of non-block-flow object.
......
......@@ -627,7 +627,6 @@ private:
virtual const char* renderName() const;
virtual bool isRenderBlock() const OVERRIDE FINAL { return true; }
virtual bool isBlockFlow() const OVERRIDE FINAL { return (!isInline() || isReplaced()) && !isTable(); }
virtual bool isInlineBlockOrInlineTable() const OVERRIDE FINAL { return isInline() && isReplaced(); }
void makeChildrenNonInline(RenderObject* insertionPoint = 0);
......
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2007 David Smith (catfish.man@gmail.com)
* Copyright (C) 2003-2013 Apple Inc. All rights reserved.
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "RenderBlockFlow.h"
namespace WebCore {
RenderBlockFlow::RenderBlockFlow(ContainerNode* node)
: RenderBlock(node)
{
}
RenderBlockFlow::~RenderBlockFlow()
{
}
} // namespace WebCore
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2007 David Smith (catfish.man@gmail.com)
* Copyright (C) 2003-2013, Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef RenderBlockFlow_h
#define RenderBlockFlow_h
#include "RenderBlock.h"
namespace WebCore {
class RenderBlockFlow : public RenderBlock {
public:
explicit RenderBlockFlow(ContainerNode*);
virtual ~RenderBlockFlow();
virtual bool isRenderBlockFlow() const OVERRIDE FINAL { return true; }
};
inline RenderBlockFlow& toRenderBlockFlow(RenderObject& object)
{
ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderBlockFlow());
return static_cast<RenderBlockFlow&>(object);
}
inline const RenderBlockFlow& toRenderBlockFlow(const RenderObject& object)
{
ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderBlockFlow());
return static_cast<const RenderBlockFlow&>(object);
}
inline RenderBlockFlow* toRenderBlockFlow(RenderObject* object)
{
ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderBlockFlow());
return static_cast<RenderBlockFlow*>(object);
}
inline const RenderBlockFlow* toRenderBlockFlow(const RenderObject* object)
{
ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderBlockFlow());
return static_cast<const RenderBlockFlow*>(object);
}
// This will catch anyone doing an unnecessary cast.
void toRenderBlockFlow(const RenderBlockFlow*);
void toRenderBlockFlow(const RenderBlockFlow&);
} // namespace WebCore
#endif // RenderBlockFlow_h
......@@ -2103,7 +2103,7 @@ void RenderBox::computeRectForRepaint(const RenderLayerModelObject* repaintConta
topLeft += layer()->offsetForInFlowPosition();
}
if (position != AbsolutePosition && position != FixedPosition && o->hasColumns() && o->isBlockFlow()) {
if (position != AbsolutePosition && position != FixedPosition && o->hasColumns() && o->isRenderBlockFlow()) {
LayoutRect repaintRect(topLeft, rect.size());
toRenderBlock(o)->adjustRectForColumns(repaintRect);
topLeft = repaintRect.location();
......@@ -4093,7 +4093,7 @@ VisiblePosition RenderBox::positionForPoint(const LayoutPoint& point)
adjustedPoint.moveBy(location());