Commit 64be122e authored by zoltan@webkit.org's avatar zoltan@webkit.org

Move BreakingContext and LineBreaker into their own files

<https://webkit.org/b/124336>

Reviewed by David Hyatt.

In this change I introduced 'line' subdirectory inside 'rendering', this directory will contain all the classes
which have been refactored from RenderBlockLineLayout.cpp. This change contains the separation of BreakingContext,
and the separation of LineBreaker classes. Since I wanted to keep the helper functions organized, I also added a
new file called LineInlineHeaders.h, which contains the functions which used in LineBreaker.h and BreakingContext.h.
I moved LineInfo class into line directory. It was necessary this time, since I added a cpp for it. I'll move the
rest of the line layout related helper classes later. (I wanted to minimize merge conflicts.)

No new tests, no behavior change.

* CMakeLists.txt:
* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCoreCommon.props:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::createRun):
* rendering/line/BreakingContextInlineHeaders.h: Added.
(WebCore::WordMeasurement::WordMeasurement):
(WebCore::TrailingObjects::TrailingObjects):
(WebCore::TrailingObjects::setTrailingWhitespace):
(WebCore::TrailingObjects::clear):
(WebCore::TrailingObjects::appendBoxIfNeeded):
(WebCore::deprecatedAddMidpoint):
(WebCore::startIgnoringSpaces):
(WebCore::stopIgnoringSpaces):
(WebCore::ensureLineBoxInsideIgnoredSpaces):
(WebCore::TrailingObjects::updateMidpointsForTrailingBoxes):
(WebCore::BreakingContext::BreakingContext):
(WebCore::BreakingContext::currentObject):
(WebCore::BreakingContext::lineBreak):
(WebCore::BreakingContext::lineBreakRef):
(WebCore::BreakingContext::lineWidth):
(WebCore::BreakingContext::atEnd):
(WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
(WebCore::BreakingContext::initializeForCurrentObject):
(WebCore::BreakingContext::increment):
(WebCore::BreakingContext::handleBR):
(WebCore::borderPaddingMarginStart):
(WebCore::borderPaddingMarginEnd):
(WebCore::shouldAddBorderPaddingMargin):
(WebCore::previousInFlowSibling):
(WebCore::inlineLogicalWidth):
(WebCore::BreakingContext::handleOutOfFlowPositioned):
(WebCore::BreakingContext::handleFloat):
(WebCore::shouldSkipWhitespaceAfterStartObject):
(WebCore::BreakingContext::handleEmptyInline):
(WebCore::BreakingContext::handleReplaced):
(WebCore::firstPositiveWidth):
(WebCore::updateSegmentsForShapes):
(WebCore::iteratorIsBeyondEndOfRenderCombineText):
(WebCore::nextCharacter):
(WebCore::updateCounterIfNeeded):
(WebCore::measureHyphenWidth):
(WebCore::textWidth):
(WebCore::ensureCharacterGetsLineBox):
(WebCore::tryHyphenating):
(WebCore::BreakingContext::handleText):
(WebCore::textBeginsWithBreakablePosition):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
(WebCore::checkMidpoints):
(WebCore::BreakingContext::handleEndOfLine):
* rendering/line/LineBreaker.cpp: Added.
(WebCore::LineBreaker::reset):
(WebCore::LineBreaker::skipTrailingWhitespace):
(WebCore::LineBreaker::skipLeadingWhitespace):
* rendering/line/LineBreaker.h: Added.
(WebCore::LineBreaker::LineBreaker):
(WebCore::LineBreaker::lineWasHyphenated):
(WebCore::LineBreaker::positionedObjects):
(WebCore::LineBreaker::clear):
* rendering/line/LineInfo.cpp: Added.
(WebCore::LineInfo::setEmpty):
* rendering/line/LineInfo.h: Renamed from Source/WebCore/rendering/LineInfo.h.
(WebCore::LineInfo::LineInfo):
(WebCore::LineInfo::isFirstLine):
(WebCore::LineInfo::isLastLine):
(WebCore::LineInfo::isEmpty):
(WebCore::LineInfo::previousLineBrokeCleanly):
(WebCore::LineInfo::floatPaginationStrut):
(WebCore::LineInfo::runsFromLeadingWhitespace):
(WebCore::LineInfo::resetRunsFromLeadingWhitespace):
(WebCore::LineInfo::incrementRunsFromLeadingWhitespace):
(WebCore::LineInfo::setFirstLine):
(WebCore::LineInfo::setLastLine):
(WebCore::LineInfo::setPreviousLineBrokeCleanly):
(WebCore::LineInfo::setFloatPaginationStrut):
* rendering/line/LineInlineHeaders.h: Added.
(WebCore::hasInlineDirectionBordersPaddingOrMargin):
(WebCore::lineStyle):
(WebCore::requiresLineBoxForContent):
(WebCore::shouldCollapseWhiteSpace):
(WebCore::skipNonBreakingSpace):
(WebCore::alwaysRequiresLineBox):
(WebCore::requiresLineBox):
(WebCore::setStaticPositions):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 05a35ca3
......@@ -76,6 +76,7 @@ set(WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/text"
"${WEBCORE_DIR}/plugins"
"${WEBCORE_DIR}/rendering"
"${WEBCORE_DIR}/rendering/line"
"${WEBCORE_DIR}/rendering/mathml"
"${WEBCORE_DIR}/rendering/shapes"
"${WEBCORE_DIR}/rendering/style"
......@@ -2209,6 +2210,9 @@ set(WebCore_SOURCES
rendering/TextPainter.cpp
rendering/break_lines.cpp
rendering/line/LineBreaker.cpp
rendering/line/LineInfo.cpp
rendering/mathml/RenderMathMLBlock.cpp
rendering/mathml/RenderMathMLFenced.cpp
rendering/mathml/RenderMathMLFraction.cpp
......
2013-11-15 Zoltan Horvath <zoltan@webkit.org>
Move BreakingContext and LineBreaker into their own files
<https://webkit.org/b/124336>
Reviewed by David Hyatt.
In this change I introduced 'line' subdirectory inside 'rendering', this directory will contain all the classes
which have been refactored from RenderBlockLineLayout.cpp. This change contains the separation of BreakingContext,
and the separation of LineBreaker classes. Since I wanted to keep the helper functions organized, I also added a
new file called LineInlineHeaders.h, which contains the functions which used in LineBreaker.h and BreakingContext.h.
I moved LineInfo class into line directory. It was necessary this time, since I added a cpp for it. I'll move the
rest of the line layout related helper classes later. (I wanted to minimize merge conflicts.)
No new tests, no behavior change.
* CMakeLists.txt:
* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCoreCommon.props:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::createRun):
* rendering/line/BreakingContextInlineHeaders.h: Added.
(WebCore::WordMeasurement::WordMeasurement):
(WebCore::TrailingObjects::TrailingObjects):
(WebCore::TrailingObjects::setTrailingWhitespace):
(WebCore::TrailingObjects::clear):
(WebCore::TrailingObjects::appendBoxIfNeeded):
(WebCore::deprecatedAddMidpoint):
(WebCore::startIgnoringSpaces):
(WebCore::stopIgnoringSpaces):
(WebCore::ensureLineBoxInsideIgnoredSpaces):
(WebCore::TrailingObjects::updateMidpointsForTrailingBoxes):
(WebCore::BreakingContext::BreakingContext):
(WebCore::BreakingContext::currentObject):
(WebCore::BreakingContext::lineBreak):
(WebCore::BreakingContext::lineBreakRef):
(WebCore::BreakingContext::lineWidth):
(WebCore::BreakingContext::atEnd):
(WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
(WebCore::BreakingContext::initializeForCurrentObject):
(WebCore::BreakingContext::increment):
(WebCore::BreakingContext::handleBR):
(WebCore::borderPaddingMarginStart):
(WebCore::borderPaddingMarginEnd):
(WebCore::shouldAddBorderPaddingMargin):
(WebCore::previousInFlowSibling):
(WebCore::inlineLogicalWidth):
(WebCore::BreakingContext::handleOutOfFlowPositioned):
(WebCore::BreakingContext::handleFloat):
(WebCore::shouldSkipWhitespaceAfterStartObject):
(WebCore::BreakingContext::handleEmptyInline):
(WebCore::BreakingContext::handleReplaced):
(WebCore::firstPositiveWidth):
(WebCore::updateSegmentsForShapes):
(WebCore::iteratorIsBeyondEndOfRenderCombineText):
(WebCore::nextCharacter):
(WebCore::updateCounterIfNeeded):
(WebCore::measureHyphenWidth):
(WebCore::textWidth):
(WebCore::ensureCharacterGetsLineBox):
(WebCore::tryHyphenating):
(WebCore::BreakingContext::handleText):
(WebCore::textBeginsWithBreakablePosition):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
(WebCore::checkMidpoints):
(WebCore::BreakingContext::handleEndOfLine):
* rendering/line/LineBreaker.cpp: Added.
(WebCore::LineBreaker::reset):
(WebCore::LineBreaker::skipTrailingWhitespace):
(WebCore::LineBreaker::skipLeadingWhitespace):
* rendering/line/LineBreaker.h: Added.
(WebCore::LineBreaker::LineBreaker):
(WebCore::LineBreaker::lineWasHyphenated):
(WebCore::LineBreaker::positionedObjects):
(WebCore::LineBreaker::clear):
* rendering/line/LineInfo.cpp: Added.
(WebCore::LineInfo::setEmpty):
* rendering/line/LineInfo.h: Renamed from Source/WebCore/rendering/LineInfo.h.
(WebCore::LineInfo::LineInfo):
(WebCore::LineInfo::isFirstLine):
(WebCore::LineInfo::isLastLine):
(WebCore::LineInfo::isEmpty):
(WebCore::LineInfo::previousLineBrokeCleanly):
(WebCore::LineInfo::floatPaginationStrut):
(WebCore::LineInfo::runsFromLeadingWhitespace):
(WebCore::LineInfo::resetRunsFromLeadingWhitespace):
(WebCore::LineInfo::incrementRunsFromLeadingWhitespace):
(WebCore::LineInfo::setFirstLine):
(WebCore::LineInfo::setLastLine):
(WebCore::LineInfo::setPreviousLineBrokeCleanly):
(WebCore::LineInfo::setFloatPaginationStrut):
* rendering/line/LineInlineHeaders.h: Added.
(WebCore::hasInlineDirectionBordersPaddingOrMargin):
(WebCore::lineStyle):
(WebCore::requiresLineBoxForContent):
(WebCore::shouldCollapseWhiteSpace):
(WebCore::skipNonBreakingSpace):
(WebCore::alwaysRequiresLineBox):
(WebCore::requiresLineBox):
(WebCore::setStaticPositions):
2013-11-15 Brady Eidson <beidson@apple.com>
Move execution of IDBTransactionBackendOperations to the IDBServerConnection
......
......@@ -91,6 +91,7 @@ webcore_cppflags += \
-I$(srcdir)/Source/WebCore/plugins \
-I$(srcdir)/Source/WebCore/plugins/win \
-I$(srcdir)/Source/WebCore/rendering \
-I$(srcdir)/Source/WebCore/rendering/line \
-I$(srcdir)/Source/WebCore/rendering/mathml \
-I$(srcdir)/Source/WebCore/rendering/shapes \
-I$(srcdir)/Source/WebCore/rendering/style \
......
......@@ -4301,7 +4301,6 @@ webcore_sources += \
Source/WebCore/rendering/LogicalSelectionOffsetCaches.h \
Source/WebCore/rendering/LayoutRepainter.h \
Source/WebCore/rendering/LayoutRepainter.cpp \
Source/WebCore/rendering/LineInfo.h \
Source/WebCore/rendering/LineLayoutState.h \
Source/WebCore/rendering/LineWidth.h \
Source/WebCore/rendering/LineWidth.cpp \
......@@ -4506,6 +4505,12 @@ webcore_sources += \
Source/WebCore/rendering/TextPainter.h \
Source/WebCore/rendering/TextPaintStyle.h \
Source/WebCore/rendering/VerticalPositionCache.h \
Source/WebCore/rendering/line/BreakingContextInlineHeaders.h \
Source/WebCore/rendering/line/LineInfo.h \
Source/WebCore/rendering/line/LineInfo.cpp \
Source/WebCore/rendering/line/LineBreaker.h \
Source/WebCore/rendering/line/LineBreaker.cpp \
Source/WebCore/rendering/line/LineInlineHeaders.h \
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp \
Source/WebCore/rendering/mathml/RenderMathMLBlock.h \
Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp \
......
......@@ -11050,6 +11050,8 @@
<ClCompile Include="..\rendering\SimpleLineLayout.cpp" />
<ClCompile Include="..\rendering\SimpleLineLayoutFunctions.cpp" />
<ClCompile Include="..\rendering\TextPaintStyle.cpp" />
<ClCompile Include="..\rendering\line\LineBreaker.cpp" />
<ClCompile Include="..\rendering\line\LineInfo.cpp" />
<ClCompile Include="..\rendering\shapes\PolygonShape.cpp" />
<ClCompile Include="..\rendering\shapes\RasterShape.cpp" />
<ClCompile Include="..\rendering\shapes\RectangleShape.cpp" />
......@@ -19779,7 +19781,6 @@
<ClInclude Include="..\rendering\InlineTextBox.h" />
<ClInclude Include="..\rendering\LayoutRepainter.h" />
<ClInclude Include="..\rendering\LayoutState.h" />
<ClInclude Include="..\rendering\LineInfo.h" />
<ClInclude Include="..\rendering\LineLayoutState.h" />
<ClInclude Include="..\rendering\LineWidth.h" />
<ClInclude Include="..\rendering\OrderIterator.h" />
......@@ -19854,6 +19855,10 @@
<ClInclude Include="..\rendering\RenderSelectionInfo.h" />
<ClInclude Include="..\rendering\RenderSlider.h" />
<ClInclude Include="..\rendering\RenderSnapshottedPlugIn.h" />
<ClInclude Include="..\rendering\line\BreakingContextInlineHeaders.h" />
<ClInclude Include="..\rendering\line\LineBreaker.h" />
<ClInclude Include="..\rendering\line\LineInfo.h" />
<ClInclude Include="..\rendering\line\LineInlineHeaders.h" />
<ClInclude Include="..\rendering\shapes\PolygonShape.h" />
<ClInclude Include="..\rendering\shapes\RasterShape.h" />
<ClInclude Include="..\rendering\shapes\RectangleShape.h" />
......@@ -7,11 +7,11 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>WebCorePrefix.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>WebCorePrefix.h;ICUVersion.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
</ClCompile>
</ItemDefinitionGroup>
</Project>
\ No newline at end of file
</Project>
......@@ -3437,7 +3437,6 @@
9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */; };
A024575116CEAA27000E5671 /* EXTDrawBuffers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A024574E16CEAA27000E5671 /* EXTDrawBuffers.cpp */; };
A024575216CEAA27000E5671 /* EXTDrawBuffers.h in Headers */ = {isa = PBXBuildFile; fileRef = A024574F16CEAA27000E5671 /* EXTDrawBuffers.h */; };
A06BFE2E17DFB43F008302BB /* LineInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A06BFE2C17DFB433008302BB /* LineInfo.h */; };
A07D3355152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A07D3353152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp */; };
A07D3356152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A07D3354152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h */; };
A07D3358152B632D001B6393 /* WebGLShaderPrecisionFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A07D3357152B632D001B6393 /* WebGLShaderPrecisionFormat.h */; };
......@@ -6299,6 +6298,8 @@
FEE1811416C319E800084849 /* SQLTransactionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE1811216C319E800084849 /* SQLTransactionBackend.h */; };
FF945ECB161F7F3600971BC8 /* PseudoElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FF945EC9161F7F3600971BC8 /* PseudoElement.cpp */; };
FF945ECC161F7F3600971BC8 /* PseudoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FF945ECA161F7F3600971BC8 /* PseudoElement.h */; };
FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CA1833EC3800158A31 /* LineBreaker.cpp */; };
FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CD1833F17600158A31 /* LineInfo.cpp */; };
FFD5B97A135CC97800D5E92A /* PageVisibilityState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */; };
FFD5B97B135CC97800D5E92A /* PageVisibilityState.h in Headers */ = {isa = PBXBuildFile; fileRef = FFD5B978135CC97800D5E92A /* PageVisibilityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
/* End PBXBuildFile section */
......@@ -10206,7 +10207,6 @@
A024574E16CEAA27000E5671 /* EXTDrawBuffers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTDrawBuffers.cpp; path = canvas/EXTDrawBuffers.cpp; sourceTree = "<group>"; };
A024574F16CEAA27000E5671 /* EXTDrawBuffers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTDrawBuffers.h; path = canvas/EXTDrawBuffers.h; sourceTree = "<group>"; };
A024575016CEAA27000E5671 /* EXTDrawBuffers.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTDrawBuffers.idl; path = canvas/EXTDrawBuffers.idl; sourceTree = "<group>"; };
A06BFE2C17DFB433008302BB /* LineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineInfo.h; sourceTree = "<group>"; };
A0718BE817E26F1600F6BF44 /* LineLayoutState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineLayoutState.h; sourceTree = "<group>"; };
A07D3353152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLShaderPrecisionFormat.cpp; sourceTree = "<group>"; };
A07D3354152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLShaderPrecisionFormat.h; sourceTree = "<group>"; };
......@@ -13472,6 +13472,11 @@
FEE1811216C319E800084849 /* SQLTransactionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionBackend.h; sourceTree = "<group>"; };
FF945EC9161F7F3600971BC8 /* PseudoElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PseudoElement.cpp; sourceTree = "<group>"; };
FF945ECA161F7F3600971BC8 /* PseudoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoElement.h; sourceTree = "<group>"; };
FFB698C91832F10B00158A31 /* BreakingContextInlineHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BreakingContextInlineHeaders.h; sourceTree = "<group>"; };
FFB698CA1833EC3800158A31 /* LineBreaker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineBreaker.cpp; sourceTree = "<group>"; };
FFB698CB1833EC3800158A31 /* LineBreaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreaker.h; sourceTree = "<group>"; };
FFB698CD1833F17600158A31 /* LineInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineInfo.cpp; sourceTree = "<group>"; };
FFB698CE1833F17600158A31 /* LineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineInfo.h; sourceTree = "<group>"; };
FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageVisibilityState.cpp; sourceTree = "<group>"; };
FFD5B978135CC97800D5E92A /* PageVisibilityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageVisibilityState.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -20901,6 +20906,7 @@
F523D2F302DE443B018635CA /* rendering */ = {
isa = PBXGroup;
children = (
FFB698C81832F10B00158A31 /* line */,
CDE7FC42181904B1002BBB77 /* OrderIterator.cpp */,
CDE7FC43181904B1002BBB77 /* OrderIterator.h */,
439046C212DA25CE00AF80A2 /* mathml */,
......@@ -20949,7 +20955,6 @@
A120ACA013F9983700FE4AC7 /* LayoutRepainter.h */,
2D9066040BE141D400956998 /* LayoutState.cpp */,
2D9066050BE141D400956998 /* LayoutState.h */,
A06BFE2C17DFB433008302BB /* LineInfo.h */,
A0718BE817E26F1600F6BF44 /* LineLayoutState.h */,
A0CB002317DF81AC0017896B /* LineWidth.cpp */,
A0CB002117DE9CD00017896B /* LineWidth.h */,
......@@ -21889,6 +21894,18 @@
name = WebAudio;
sourceTree = "<group>";
};
FFB698C81832F10B00158A31 /* line */ = {
isa = PBXGroup;
children = (
FFB698CD1833F17600158A31 /* LineInfo.cpp */,
FFB698CE1833F17600158A31 /* LineInfo.h */,
FFB698CA1833EC3800158A31 /* LineBreaker.cpp */,
FFB698CB1833EC3800158A31 /* LineBreaker.h */,
FFB698C91832F10B00158A31 /* BreakingContextInlineHeaders.h */,
);
path = line;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
......@@ -25182,7 +25199,6 @@
BE16C59517CFE17200852C04 /* InbandWebVTTTextTrack.h in Headers */,
BC10D76817D8EE71005E2626 /* RenderBlockFlow.h in Headers */,
A0CB002517DF826C0017896B /* LineWidth.h in Headers */,
A06BFE2E17DFB43F008302BB /* LineInfo.h in Headers */,
CD3E251C18046B0600E27F56 /* GridCoordinate.h in Headers */,
CD3E252418046BCD00E27F56 /* CSSGridTemplateValue.h in Headers */,
CDEF4FD717E85C8F00AEE24B /* GridLength.h in Headers */,
......@@ -25767,6 +25783,7 @@
977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,
A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */,
78D02BC5154A18DF00B62D05 /* CSSPropertyAnimation.cpp in Sources */,
1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
07C59B5617F4AC15000FBCBB /* VideoStreamTrack.cpp in Sources */,
......@@ -26573,6 +26590,7 @@
070363E5181A1CDC00C074A5 /* AVMediaCaptureSource.mm in Sources */,
9392262F10321084006E7D5D /* JSCSSRuleListCustom.cpp in Sources */,
142011B60A003133008303F9 /* JSCSSStyleDeclaration.cpp in Sources */,
FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */,
BC5825F30C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp in Sources */,
BC46C2060C0DDCA10020CFC3 /* JSCSSStyleRule.cpp in Sources */,
BCC5BE000C0E93110011C2DB /* JSCSSStyleSheet.cpp in Sources */,
This diff is collapsed.
/*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2013 ChangSeok Oh <shivamidow@gmail.com>
* Copyright (C) 2013 Adobe Systems Inc. All right 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 "LineBreaker.h"
#include "RenderCombineText.h"
namespace WebCore {
void LineBreaker::reset()
{
m_positionedObjects.clear();
m_hyphenated = false;
m_clear = CNONE;
}
// FIXME: The entire concept of the skipTrailingWhitespace function is flawed, since we really need to be building
// line boxes even for containers that may ultimately collapse away. Otherwise we'll never get positioned
// elements quite right. In other words, we need to build this function's work into the normal line
// object iteration process.
// NB. this function will insert any floating elements that would otherwise
// be skipped but it will not position them.
void LineBreaker::skipTrailingWhitespace(InlineIterator& iterator, const LineInfo& lineInfo)
{
while (!iterator.atEnd() && !requiresLineBox(iterator, lineInfo, TrailingWhitespace)) {
RenderObject& object = *iterator.m_obj;
if (object.isOutOfFlowPositioned())
setStaticPositions(m_block, toRenderBox(object));
else if (object.isFloating())
m_block.insertFloatingObject(toRenderBox(object));
iterator.increment();
}
}
void LineBreaker::skipLeadingWhitespace(InlineBidiResolver& resolver, LineInfo& lineInfo, FloatingObject* lastFloatFromPreviousLine, LineWidth& width)
{
while (!resolver.position().atEnd() && !requiresLineBox(resolver.position(), lineInfo, LeadingWhitespace)) {
RenderObject& object = *resolver.position().m_obj;
if (object.isOutOfFlowPositioned()) {
setStaticPositions(m_block, toRenderBox(object));
if (object.style().isOriginalDisplayInlineType()) {
resolver.runs().addRun(new BidiRun(0, 1, object, resolver.context(), resolver.dir()));
lineInfo.incrementRunsFromLeadingWhitespace();
}
} else if (object.isFloating()) {
// The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
// so in order to place this first child float at the top content edge of the self-collapsing block add the margin back in before placement.
LayoutUnit marginOffset = (!object.previousSibling() && m_block.isSelfCollapsingBlock() && m_block.style().clear() && m_block.getClearDelta(m_block, LayoutUnit())) ? m_block.collapsedMarginBeforeForChild(m_block) : LayoutUnit();
LayoutUnit oldLogicalHeight = m_block.logicalHeight();
m_block.setLogicalHeight(oldLogicalHeight + marginOffset);
m_block.positionNewFloatOnLine(m_block.insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width);
m_block.setLogicalHeight(oldLogicalHeight);
} else if (object.isText() && object.style().hasTextCombine() && object.isCombineText() && !toRenderCombineText(object).isCombined()) {
toRenderCombineText(object).combineText();
if (toRenderCombineText(object).isCombined())
continue;
}
resolver.increment();
}
resolver.commitExplicitEmbedding();
}
}
/*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2013 ChangSeok Oh <shivamidow@gmail.com>
* Copyright (C) 2013 Adobe Systems Inc. All right 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 LineBreaker_h
#define LineBreaker_h
#include "InlineIterator.h"
#include "LineInfo.h"
#include "LineInlineHeaders.h"
#include <wtf/Vector.h>
namespace WebCore {
class RenderText;
struct RenderTextInfo {
// Destruction of m_layout requires TextLayout to be a complete type, so the constructor and destructor are made non-inline to avoid compilation errors.
RenderTextInfo();
~RenderTextInfo();
RenderText* m_text;
OwnPtr<TextLayout> m_layout;
LazyLineBreakIterator m_lineBreakIterator;
const Font* m_font;
};
class LineBreaker {
public:
friend class BreakingContext;
LineBreaker(RenderBlockFlow& block)
: m_block(block)
{
reset();
}
InlineIterator nextLineBreak(InlineBidiResolver&, LineInfo&, RenderTextInfo&, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&);
bool lineWasHyphenated() { return m_hyphenated; }
const Vector<RenderBox*>& positionedObjects() { return m_positionedObjects; }
EClear clear() { return m_clear; }
private:
void reset();
InlineIterator nextSegmentBreak(InlineBidiResolver&, LineInfo&, RenderTextInfo&, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&);
void skipTrailingWhitespace(InlineIterator&, const LineInfo&);
void skipLeadingWhitespace(InlineBidiResolver&, LineInfo&, FloatingObject* lastFloatFromPreviousLine, LineWidth&);
RenderBlockFlow& m_block;
bool m_hyphenated;
EClear m_clear;
Vector<RenderBox*> m_positionedObjects;
};
}
#endif // LineBreaker_h
/*
* Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "LineInfo.h"
#include "RenderBlock.h"
namespace WebCore {
void LineInfo::setEmpty(bool empty, RenderBlock* block, LineWidth* lineWidth)
{
if (m_isEmpty == empty)
return;
m_isEmpty = empty;
if (!empty && block && floatPaginationStrut()) {
block->setLogicalHeight(block->logicalHeight() + floatPaginationStrut());
setFloatPaginationStrut(0);
lineWidth->updateAvailableWidth();
}
}
}
......@@ -34,6 +34,8 @@
namespace WebCore {
class RenderBlock;
class LineInfo {
public:
LineInfo()
......@@ -56,18 +58,7 @@ public:
void setFirstLine(bool firstLine) { m_isFirstLine = firstLine; }
void setLastLine(bool lastLine) { m_isLastLine = lastLine; }
void setEmpty(bool empty, RenderBlock* block = 0, LineWidth* lineWidth = 0)
{
if (m_isEmpty == empty)
return;
m_isEmpty = empty;
if (!empty && block && floatPaginationStrut()) {
block->setLogicalHeight(block->logicalHeight() + floatPaginationStrut());
setFloatPaginationStrut(0);
lineWidth->updateAvailableWidth();
}
}
void setEmpty(bool empty, RenderBlock* block = 0, LineWidth* lineWidth = 0);
void setPreviousLineBrokeCleanly(bool previousLineBrokeCleanly) { m_previousLineBrokeCleanly = previousLineBrokeCleanly; }
void setFloatPaginationStrut(LayoutUnit strut) { m_floatPaginationStrut = strut; }
......
/*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2013 ChangSeok Oh <shivamidow@gmail.com>
* Copyright (C) 2013 Adobe Systems Inc. All right 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 LineInlineHeaders_h
#define LineInlineHeaders_h
#include "RenderLayer.h"
namespace WebCore {
enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace };
inline bool hasInlineDirectionBordersPaddingOrMargin(const RenderInline& flow)
{
// Where an empty inline is split across anonymous blocks we should only give lineboxes to the 'sides' of the
// inline that have borders, padding or margin.
bool shouldApplyStartBorderPaddingOrMargin = !flow.parent()->isAnonymousBlock() || !flow.isInlineElementContinuation();
if (shouldApplyStartBorderPaddingOrMargin && (flow.borderStart() || flow.marginStart() || flow.paddingStart()))
return true;
bool shouldApplyEndBorderPaddingOrMargin = !flow.parent()->isAnonymousBlock() || flow.isInlineElementContinuation() || !flow.inlineElementContinuation();
return shouldApplyEndBorderPaddingOrMargin && (flow.borderEnd() || flow.marginEnd() || flow.paddingEnd());
}
inline const RenderStyle& lineStyle(const RenderElement& renderer, const LineInfo& lineInfo)
{
return lineInfo.isFirstLine() ? renderer.firstLineStyle() : renderer.style();
}
inline bool requiresLineBoxForContent(const RenderInline& flow, const LineInfo& lineInfo)
{
RenderElement* parent = flow.parent();
if (flow.document().inNoQuirksMode()) {
const RenderStyle& flowStyle = lineStyle(flow, lineInfo);
const RenderStyle& parentStyle = lineStyle(*parent, lineInfo);
if (flowStyle.lineHeight() != parentStyle.lineHeight()
|| flowStyle.verticalAlign() != parentStyle.verticalAlign()
|| !parentStyle.font().fontMetrics().hasIdenticalAscentDescentAndLineGap(flowStyle.font().fontMetrics()))
return true;
}
return false;
}
inline bool shouldCollapseWhiteSpace(const RenderStyle* style, const LineInfo& lineInfo, WhitespacePosition whitespacePosition)
{
// CSS2 16.6.1
// If a space (U+0020) at the beginning of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is removed.
// If a space (U+0020) at the end of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is also removed.
// If spaces (U+0020) or tabs (U+0009) at the end of a line have 'white-space' set to 'pre-wrap', UAs may visually collapse them.
return style->collapseWhiteSpace()
|| (whitespacePosition == TrailingWhitespace && style->whiteSpace() == PRE_WRAP && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
}
inline bool skipNonBreakingSpace(const InlineIterator& it, const LineInfo& lineInfo)
{
if (it.m_obj->style().nbspMode() != SPACE || it.current() != noBreakSpace)
return false;
// FIXME: This is bad. It makes nbsp inconsistent with space and won't work correctly
// with m_minWidth/m_maxWidth.
// Do not skip a non-breaking space if it is the first character
// on a line after a clean line break (or on the first line, since previousLineBrokeCleanly starts off
// |true|).
if (lineInfo.isEmpty() && lineInfo.previousLineBrokeCleanly())
return false;
return true;
}