#include "core/dom/Document.h"
#include "core/fetch/ImageResource.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
#include "core/rendering/GraphicsContextAnnotator.h"
+#include "core/rendering/LayoutRectRecorder.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderListItem.h"
#include "core/rendering/RenderView.h"
+#include "platform/fonts/Font.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
#include "wtf/text/StringBuilder.h"
#include "wtf/unicode/CharacterNames.h"
InlineBox* box = inlineBoxWrapper();
if (!box)
return LayoutRect(LayoutPoint(), size());
- RootInlineBox* root = m_inlineBoxWrapper->root();
- LayoutUnit newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTop() - m_inlineBoxWrapper->logicalTop();
+ RootInlineBox* root = inlineBoxWrapper()->root();
+ LayoutUnit newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? inlineBoxWrapper()->logicalBottom() - root->selectionBottom() : root->selectionTop() - inlineBoxWrapper()->logicalTop();
if (root->block()->style()->isHorizontalWritingMode())
return LayoutRect(0, newLogicalTop, width(), root->selectionHeight());
return LayoutRect(newLogicalTop, 0, root->selectionHeight(), height());
}
const UChar suffix = listMarkerSuffix(type, m_listItem->value());
+ UChar suffixStr[2] = {
+ style()->isLeftToRightDirection() ? suffix : ' ',
+ style()->isLeftToRightDirection() ? ' ' : suffix
+ };
+ TextRun suffixRun = RenderBlockFlow::constructTextRun(this, font, suffixStr, 2, style(), style()->direction());
+ TextRunPaintInfo suffixRunInfo(suffixRun);
+ suffixRunInfo.bounds = marker;
+
if (style()->isLeftToRightDirection()) {
context->drawText(font, textRunPaintInfo, textOrigin);
-
- UChar suffixSpace[2] = { suffix, ' ' };
- TextRun suffixRun = RenderBlockFlow::constructTextRun(this, font, suffixSpace, 2, style());
- TextRunPaintInfo suffixRunInfo(suffixRun);
- suffixRunInfo.bounds = marker;
context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.width(textRun), 0));
} else {
- UChar spaceSuffix[2] = { ' ', suffix };
- TextRun suffixRun = RenderBlockFlow::constructTextRun(this, font, spaceSuffix, 2, style());
- TextRunPaintInfo suffixRunInfo(suffixRun);
- suffixRunInfo.bounds = marker;
context->drawText(font, suffixRunInfo, textOrigin);
-
context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.width(suffixRun), 0));
}
}
{
ASSERT(needsLayout());
+ LayoutRectRecorder recorder(*this);
if (isImage()) {
updateMarginsAndContent();
setWidth(m_image->imageSize(this, style()->effectiveZoom()).width());
else {
LayoutUnit itemWidth = font.width(m_text);
UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' };
- LayoutUnit suffixSpaceWidth = font.width(RenderBlockFlow::constructTextRun(this, font, suffixSpace, 2, style()));
+ LayoutUnit suffixSpaceWidth = font.width(RenderBlockFlow::constructTextRun(this, font, suffixSpace, 2, style(), style()->direction()));
logicalWidth = itemWidth + suffixSpaceWidth;
}
break;
const Font& font = style()->font();
int itemWidth = font.width(m_text);
UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' };
- int suffixSpaceWidth = font.width(RenderBlockFlow::constructTextRun(this, font, suffixSpace, 2, style()));
+ int suffixSpaceWidth = font.width(RenderBlockFlow::constructTextRun(this, font, suffixSpace, 2, style(), style()->direction()));
relativeRect = IntRect(0, 0, itemWidth + suffixSpaceWidth, font.fontMetrics().height());
}
// The selection state for our containing block hierarchy is updated by the base class call.
RenderBox::setSelectionState(state);
- if (m_inlineBoxWrapper && canUpdateSelectionOnRootLineBoxes())
- if (RootInlineBox* root = m_inlineBoxWrapper->root())
+ if (inlineBoxWrapper() && canUpdateSelectionOnRootLineBoxes())
+ if (RootInlineBox* root = inlineBoxWrapper()->root())
root->setHasSelectedChildren(state != SelectionNone);
}