summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering/line
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/line')
-rw-r--r--Source/WebCore/rendering/line/BreakingContext.h6
-rw-r--r--Source/WebCore/rendering/line/LineWidth.cpp4
-rw-r--r--Source/WebCore/rendering/line/LineWidth.h8
3 files changed, 15 insertions, 3 deletions
diff --git a/Source/WebCore/rendering/line/BreakingContext.h b/Source/WebCore/rendering/line/BreakingContext.h
index 799d2c063..fff452898 100644
--- a/Source/WebCore/rendering/line/BreakingContext.h
+++ b/Source/WebCore/rendering/line/BreakingContext.h
@@ -559,9 +559,9 @@ inline void BreakingContext::handleReplaced()
m_ignoringSpaces = true;
}
if (downcast<RenderListMarker>(*m_current.renderer()).isInside())
- m_width.addUncommittedWidth(replacedLogicalWidth);
+ m_width.addUncommittedReplacedWidth(replacedLogicalWidth);
} else
- m_width.addUncommittedWidth(replacedLogicalWidth);
+ m_width.addUncommittedReplacedWidth(replacedLogicalWidth);
if (is<RenderRubyRun>(*m_current.renderer())) {
m_width.applyOverhang(downcast<RenderRubyRun>(m_current.renderer()), m_lastObject, m_nextObject);
downcast<RenderRubyRun>(m_current.renderer())->updatePriorContextFromCachedBreakIterator(m_renderTextInfo.lineBreakIterator);
@@ -748,7 +748,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
bool breakNBSP = m_autoWrap && m_currentStyle->nbspMode() == SPACE;
// Auto-wrapping text should wrap in the middle of a word only if it could not wrap before the word,
// which is only possible if the word is the first thing on the line.
- bool breakWords = m_currentStyle->breakWords() && ((m_autoWrap && !m_width.hasCommitted()) || m_currWS == PRE);
+ bool breakWords = m_currentStyle->breakWords() && ((m_autoWrap && (!m_width.committedWidth() && !m_width.hasCommittedReplaced())) || m_currWS == PRE);
bool midWordBreak = false;
bool breakAll = m_currentStyle->wordBreak() == BreakAllWordBreak && m_autoWrap;
bool keepAllWords = m_currentStyle->wordBreak() == KeepAllWordBreak;
diff --git a/Source/WebCore/rendering/line/LineWidth.cpp b/Source/WebCore/rendering/line/LineWidth.cpp
index 71e05cb23..b28406d63 100644
--- a/Source/WebCore/rendering/line/LineWidth.cpp
+++ b/Source/WebCore/rendering/line/LineWidth.cpp
@@ -128,6 +128,10 @@ void LineWidth::commit()
{
m_committedWidth += m_uncommittedWidth;
m_uncommittedWidth = 0;
+ if (m_hasUncommittedReplaced) {
+ m_hasCommittedReplaced = true;
+ m_hasUncommittedReplaced = false;
+ }
m_hasCommitted = true;
}
diff --git a/Source/WebCore/rendering/line/LineWidth.h b/Source/WebCore/rendering/line/LineWidth.h
index 370b3a0f8..bcb274c8e 100644
--- a/Source/WebCore/rendering/line/LineWidth.h
+++ b/Source/WebCore/rendering/line/LineWidth.h
@@ -60,6 +60,7 @@ public:
float logicalLeftOffset() const { return m_left; }
bool hasCommitted() const { return m_hasCommitted; }
+ bool hasCommittedReplaced() const { return m_hasCommittedReplaced; }
void updateAvailableWidth(LayoutUnit minimumHeight = 0);
void shrinkAvailableWidthForNewFloatIfNeeded(const FloatingObject&);
@@ -67,6 +68,11 @@ public:
{
m_uncommittedWidth += delta;
}
+ void addUncommittedReplacedWidth(float delta)
+ {
+ addUncommittedWidth(delta);
+ m_hasUncommittedReplaced = true;
+ }
void commit();
void applyOverhang(RenderRubyRun*, RenderObject* startRenderer, RenderObject* endRenderer);
void fitBelowFloats(bool isFirstLine = false);
@@ -92,6 +98,8 @@ private:
float m_availableWidth { 0 };
bool m_isFirstLine { true };
bool m_hasCommitted { false };
+ bool m_hasCommittedReplaced { false };
+ bool m_hasUncommittedReplaced { false };
IndentTextOrNot m_shouldIndentText;
};