REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
https://bugs.webkit.org/show_bug.cgi?id=188018
<rdar://problem/42517520>
Reviewed by Dean Jackson.
Source/WebCore:
Manual rollout of r227577.
Test: fast/overflow/line-clamp-with-text-shadow.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeLinesClamp): Deleted.
* page/Settings.yaml:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns const):
(WebCore::getHeightForLineCount):
(WebCore::RenderBlockFlow::heightForLineCount):
(WebCore::RenderBlockFlow::layoutExcludedChildren):
(WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
(WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
* rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
* rendering/RenderFragmentContainer.h:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::validateFragments):
(WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
(WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderLinesClampFlow.cpp: Removed.
* rendering/RenderLinesClampFlow.h: Removed.
* rendering/RenderLinesClampSet.cpp: Removed.
* rendering/RenderLinesClampSet.h: Removed.
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
(WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
* rendering/RenderMultiColumnFlow.h:
(WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
(WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
(WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
(WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
(WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
(WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
(WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
(WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
(WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
(WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
(WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
(WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
(WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
(WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
(WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
(WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
(WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
(WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::collectLayerFragments):
(WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
* rendering/RenderMultiColumnSet.h:
(WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
(WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
(WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
(WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
(WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
(WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
(WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
(WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
(WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
(WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
(WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
(WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
(WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
(WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
(WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
(WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
(WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
* rendering/style/LineClampValue.h:
(WebCore::LinesClampValue::LinesClampValue): Deleted.
(WebCore::LinesClampValue::isNone const): Deleted.
(WebCore::LinesClampValue::operator== const): Deleted.
(WebCore::LinesClampValue::operator!= const): Deleted.
(WebCore::LinesClampValue::start const): Deleted.
(WebCore::LinesClampValue::end const): Deleted.
(WebCore::LinesClampValue::center const): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::lineClamp const):
(WebCore::RenderStyle::setLineClamp):
(WebCore::RenderStyle::initialLineClamp):
(WebCore::RenderStyle::hasInlineColumnAxis const):
(WebCore::RenderStyle::linesClamp const): Deleted.
(WebCore::RenderStyle::hasLinesClamp const): Deleted.
(WebCore::RenderStyle::setLinesClamp): Deleted.
(WebCore::RenderStyle::initialLinesClamp): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::isValidColumnSpanner):
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
Source/WebKit:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
LayoutTests:
* fast/block/lines-clamp-advanced-expected.html: Removed.
* fast/block/lines-clamp-advanced-rl-expected.html: Removed.
* fast/block/lines-clamp-advanced-rl.html: Removed.
* fast/block/lines-clamp-advanced.html: Removed.
* fast/block/lines-clamp-basic-expected.html: Removed.
* fast/block/lines-clamp-basic-rl-expected.html: Removed.
* fast/block/lines-clamp-basic-rl.html: Removed.
* fast/block/lines-clamp-basic.html: Removed.
* fast/css/lines-clamp-parsing-expected.txt: Removed.
* fast/css/lines-clamp-parsing.html: Removed.
* fast/overflow/line-clamp-with-text-shadow-expected.html: Added.
* fast/overflow/line-clamp-with-text-shadow.html: Added.
* platform/ios-simulator-wk2/fast/overflow/line-clamp-expected.txt: Removed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@234215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index e81d0a2..132dc8f 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -424,11 +424,7 @@
// If overflow-y is set to paged-x or paged-y on the body or html element, we'll handle the paginating in the RenderView instead.
if ((style().overflowY() == Overflow::PagedX || style().overflowY() == Overflow::PagedY) && !(isDocumentElementRenderer() || isBody()))
return true;
-
- // Lines clamping creates columns.
- if (style().hasLinesClamp())
- return true;
-
+
if (!style().specifiesColumns())
return false;
@@ -3212,54 +3208,37 @@
return count;
}
-static int getHeightForLineCount(const RenderBlockFlow& block, int lineCount, bool includeEdgeBorderPadding, bool forward, int& count)
+static int getHeightForLineCount(const RenderBlockFlow& block, int lineCount, bool includeBottom, int& count)
{
if (block.style().visibility() != Visibility::Visible)
return -1;
- // FIXME: Orthogonal writing modes don't work here, but it's not even clear how they should behave anyway.
if (block.childrenInline()) {
- for (auto* box = forward ? block.firstRootBox() : block.lastRootBox(); box; box = forward ? box->nextRootBox() : box->prevRootBox()) {
- if (++count == lineCount) {
- // Matches the pagination rules in adjustLinePositionsForPagination.
- LayoutRect logicalVisualOverflow = box->logicalVisualOverflowRect(box->lineTop(), box->lineBottom());
- LayoutUnit logicalTop = std::min(box->lineTopWithLeading(), logicalVisualOverflow.y());
- LayoutUnit logicalBottom = std::max(box->lineBottomWithLeading(), logicalVisualOverflow.maxY());
- if (forward)
- return logicalBottom + (includeEdgeBorderPadding ? (block.borderAndPaddingAfter()) : LayoutUnit());
- return logicalTop + (includeEdgeBorderPadding ? (block.borderAndPaddingBefore()) : LayoutUnit());
- }
+ for (auto* box = block.firstRootBox(); box; box = box->nextRootBox()) {
+ if (++count == lineCount)
+ return box->lineBottom() + (includeBottom ? (block.borderBottom() + block.paddingBottom()) : LayoutUnit());
}
} else {
RenderBox* normalFlowChildWithoutLines = nullptr;
- for (auto* obj = forward ? block.firstChildBox() : block.lastChildBox(); obj; obj = forward ? obj->nextSiblingBox() : obj->previousSiblingBox()) {
+ for (auto* obj = block.firstChildBox(); obj; obj = obj->nextSiblingBox()) {
if (is<RenderBlockFlow>(*obj) && shouldCheckLines(downcast<RenderBlockFlow>(*obj))) {
- int result = getHeightForLineCount(downcast<RenderBlockFlow>(*obj), lineCount, false, forward, count);
- if (result != -1) {
- if (forward)
- return result + block.logicalTopForChild(*obj) + (includeEdgeBorderPadding ? (block.borderAndPaddingAfter()) : LayoutUnit());
- return result + block.logicalTopForChild(*obj) + (includeEdgeBorderPadding ? (block.borderAndPaddingBefore()) : LayoutUnit());
- }
+ int result = getHeightForLineCount(downcast<RenderBlockFlow>(*obj), lineCount, false, count);
+ if (result != -1)
+ return result + obj->y() + (includeBottom ? (block.borderBottom() + block.paddingBottom()) : LayoutUnit());
} else if (!obj->isFloatingOrOutOfFlowPositioned())
normalFlowChildWithoutLines = obj;
}
if (normalFlowChildWithoutLines && !lineCount)
- return block.logicalTopForChild(*normalFlowChildWithoutLines) + block.logicalHeightForChild(*normalFlowChildWithoutLines);
+ return normalFlowChildWithoutLines->y() + normalFlowChildWithoutLines->height();
}
return -1;
}
-int RenderBlockFlow::logicalHeightForLineCount(int lineCount)
+int RenderBlockFlow::heightForLineCount(int lineCount)
{
int count = 0;
- return getHeightForLineCount(*this, lineCount, true, true, count);
-}
-
-int RenderBlockFlow::logicalHeightExcludingLineCount(int lineCount)
-{
- int count = 0;
- return getHeightForLineCount(*this, lineCount, true, false, count);
+ return getHeightForLineCount(*this, lineCount, true, count);
}
void RenderBlockFlow::clearTruncation()
@@ -3838,8 +3817,6 @@
fragmentedFlow->setNeedsHeightsRecalculation(false);
}
determineLogicalLeftPositionForChild(*fragmentedFlow);
-
- fragmentedFlow->layoutFlowExcludedObjects(relayoutChildren);
}
void RenderBlockFlow::checkForPaginationLogicalHeightChange(bool& relayoutChildren, LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged)