2009-01-26 David Hyatt <hyatt@apple.com>
Drop support for display:compact.
(1) display:compact is no longer part of CSS2.1.
(2) Shipping Safari has completely broken compact support with severely broken rendering
(all of the compact text just piles on top of the text in the inserted block and on top of itself as well).
(3) This has been broken in WebKit for years (ever since blocks converted to painting lines directly) without
anyone even noticing.
Reviewed by Eric Seidel
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesHorizontally):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::handleSpecialChild):
(WebCore::RenderBlock::handleRunInChild):
(WebCore::RenderBlock::layoutBlockChildren):
(WebCore::RenderBlock::paint):
(WebCore::RenderBlock::paintObject):
(WebCore::RenderBlock::nodeAtPoint):
(WebCore::RenderBlock::positionForCoordinates):
(WebCore::shouldCheckLines):
(WebCore::getHeightForLineCount):
(WebCore::RenderBlock::renderName):
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::sizesToIntrinsicWidth):
* rendering/RenderBox.h:
(WebCore::RenderBox::width):
(WebCore::RenderBox::height):
(WebCore::RenderBox::size):
(WebCore::RenderBox::frameRect):
* rendering/RenderFlow.cpp:
(WebCore::RenderFlow::paintLines):
(WebCore::RenderFlow::hitTestLines):
(WebCore::RenderFlow::absoluteClippedOverflowRect):
(WebCore::RenderFlow::linesBoundingBox):
* rendering/RenderObject.h:
(WebCore::RenderObject::isInline):
* rendering/bidi.cpp:
(WebCore::RenderBlock::computeHorizontalPositionsForLine):
(WebCore::RenderBlock::layoutInlineChildren):
* rendering/bidi.h:
(WebCore::BidiRun::BidiRun):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/rendering/bidi.cpp b/WebCore/rendering/bidi.cpp
index 53fad27..87c1845 100644
--- a/WebCore/rendering/bidi.cpp
+++ b/WebCore/rendering/bidi.cpp
@@ -590,7 +590,7 @@
}
if (int length = rt->textLength()) {
- if (!r->m_compact && !r->m_start && needsWordSpacing && isSpaceOrNewline(rt->characters()[r->m_start]))
+ if (!r->m_start && needsWordSpacing && isSpaceOrNewline(rt->characters()[r->m_start]))
totWidth += rt->style(m_firstLine)->font().wordSpacing();
needsWordSpacing = !isSpaceOrNewline(rt->characters()[r->m_stop - 1]) && r->m_stop == length;
}
@@ -599,13 +599,10 @@
RenderBox* renderBox = toRenderBox(r->m_object);
renderBox->calcWidth();
r->m_box->setWidth(renderBox->width());
- if (!r->m_compact)
- totWidth += renderBox->marginLeft() + renderBox->marginRight();
+ totWidth += renderBox->marginLeft() + renderBox->marginRight();
}
- // Compacts don't contribute to the width of the line, since they are placed in the margin.
- if (!r->m_compact)
- totWidth += r->m_box->width();
+ totWidth += r->m_box->width();
}
// Armed with the total width of the line (without justification),
@@ -686,7 +683,7 @@
continue;
int spaceAdd = 0;
- if (r->m_object->isText() && !r->m_compact) {
+ if (r->m_object->isText()) {
unsigned spaces = 0;
const UChar* characters = toRenderText(r->m_object)->characters();
for (int i = r->m_start; i < r->m_stop; i++) {
@@ -754,34 +751,6 @@
resolver.createBidiRunsForLine(end, style()->visuallyOrdered(), previousLineBrokeCleanly);
}
-static void buildCompactRuns(RenderObject* compactObj, InlineBidiResolver& resolver)
-{
- ASSERT(compactObj->isRenderBlock());
- ASSERT(!resolver.firstRun());
-
- // Format the compact like it is its own single line. We build up all the runs for
- // the little compact and then reorder them for bidi.
- RenderBlock* compactBlock = static_cast<RenderBlock*>(compactObj);
-
- InlineIterator start(compactBlock, bidiFirst(compactBlock, &resolver), 0);
- resolver.setPosition(start);
-
- betweenMidpoints = false;
- isLineEmpty = true;
- previousLineBrokeCleanly = true;
-
- InlineIterator end = compactBlock->findNextLineBreak(resolver);
- if (!isLineEmpty)
- compactBlock->bidiReorderLine(resolver, end);
-
- for (BidiRun* run = resolver.firstRun(); run; run = run->next())
- run->m_compact = true;
-
- sNumMidpoints = 0;
- sCurrMidpoint = 0;
- betweenMidpoints = false;
-}
-
static inline bool isCollapsibleSpace(UChar character, RenderText* renderer)
{
if (character == ' ' || character == '\t' || character == softHyphen)
@@ -941,10 +910,7 @@
betweenMidpoints = false;
isLineEmpty = true;
- if (m_firstLine && firstChild()->isCompact() && firstChild()->isRenderBlock()) {
- buildCompactRuns(firstChild(), resolver);
- resolver.setPosition(InlineIterator(this, firstChild()->nextSibling(), 0));
- }
+
EClear clear = CNONE;
end = findNextLineBreak(resolver, &clear);
if (resolver.position().atEnd()) {