summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering/InlineTextBox.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 14:41:47 +0100
committerSteve Block <steveblock@google.com>2011-05-25 12:25:49 +0100
commit09b60ab8488b362c96df8f268613aafaeebfcfa1 (patch)
tree1623751ea9c32fc80fa309017b5d9ea3c7871415 /Source/WebCore/rendering/InlineTextBox.cpp
parentd73b16bdebb9d20b17be0a30e626dc9e66b6d868 (diff)
downloadexternal_webkit-09b60ab8488b362c96df8f268613aafaeebfcfa1.zip
external_webkit-09b60ab8488b362c96df8f268613aafaeebfcfa1.tar.gz
external_webkit-09b60ab8488b362c96df8f268613aafaeebfcfa1.tar.bz2
Merge WebKit at r78450: Fix remaining conflicts
- Document.cpp Conflict due to AX object cache disabled on Android See http://trac.webkit.org/changeset/78314 - CachedResourceLoader.cpp/h Conflict due to ANDROID_BLOCK_NETWORK_IMAGE See http://trac.webkit.org/changeset/76701 - Source/WebCore/page/ChromeClient.h Conflict due to ANDROID_INSTALLABLE_WEB_APPS See http://trac.webkit.org/changeset/77509 - FrameView.cpp Conflict due to Android FrameView::updatePositionedObjects() See http://trac.webkit.org/changeset/77274 - ScrollView.h Conflict due to Android ScrollView::actualWidth/Height/ScrollX/ScrollY() See http://trac.webkit.org/changeset/76831 - TemporaryLinkStubs.cpp and MIMETypeRegistry.cpp conflict due to Android stubbed out MIMETypeRegistry::getMIMETypeForExtension() See http://trac.webkit.org/changeset/77368 and https://android-git.corp.google.com/g/#change,37272 - ImageDecoder.cpp Conflict due to Android excluding code See http://trac.webkit.org/changeset/77427 - ImageDecoder.h Conflict due to ANDROID guard upstreamed as SKIA guard See http://trac.webkit.org/changeset/77946 - InlineTextBox.cpp Conflict due to ANDROID_DISABLE_ROUNDING_HACKS See http://trac.webkit.org/changeset/76743 and http://trac.webkit.org/changeset/77286 - RenderBlockLineLayout.cpp Conflict due to ANDROID_LAYOUT See http://trac.webkit.org/changeset/77062 Change-Id: Ide4d58dc52418b8fc1a965a9524eb57cd46b4859
Diffstat (limited to 'Source/WebCore/rendering/InlineTextBox.cpp')
-rw-r--r--Source/WebCore/rendering/InlineTextBox.cpp53
1 files changed, 10 insertions, 43 deletions
diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp
index 9f7e024..37f7eff 100644
--- a/Source/WebCore/rendering/InlineTextBox.cpp
+++ b/Source/WebCore/rendering/InlineTextBox.cpp
@@ -163,17 +163,13 @@ IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos)
ePos = len;
}
-<<<<<<< HEAD
#ifdef ANDROID_DISABLE_ROUNDING_HACKS
- TextRun textRun = TextRun(characters, len, textObj->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride);
+ TextRun textRun = TextRun(characters, len, textObj->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride);
if (m_disableRoundingHacks)
textRun.disableRoundingHacks();
IntRect r = enclosingIntRect(f.selectionRectForText(textRun, IntPoint(), selHeight, sPos, ePos));
#else
- IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride),
-=======
IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride),
->>>>>>> webkit.org at r78450
IntPoint(), selHeight, sPos, ePos));
#endif
@@ -629,15 +625,11 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
if (hasHyphen())
adjustCharactersAndLengthForHyphen(charactersWithHyphen, styleToUse, characters, length);
-<<<<<<< HEAD
- TextRun textRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || styleToUse->visuallyOrdered());
+ TextRun textRun(characters, length, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride || styleToUse->visuallyOrdered());
#ifdef ANDROID_DISABLE_ROUNDING_HACKS
if (m_disableRoundingHacks)
textRun.disableRoundingHacks();
#endif
-=======
- TextRun textRun(characters, length, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride || styleToUse->visuallyOrdered());
->>>>>>> webkit.org at r78450
int sPos = 0;
int ePos = 0;
@@ -791,18 +783,14 @@ void InlineTextBox::paintSelection(GraphicsContext* context, const IntPoint& box
int selHeight = selectionHeight();
IntPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
context->clip(IntRect(localOrigin, IntSize(m_logicalWidth, selHeight)));
-<<<<<<< HEAD
#ifdef ANDROID_DISABLE_ROUNDING_HACKS
- TextRun textRun = TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd,
+ TextRun textRun = TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(),
!isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
if (m_disableRoundingHacks)
textRun.disableRoundingHacks();
context->drawHighlightForText(font, textRun, localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
#else
- context->drawHighlightForText(font, TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd,
-=======
context->drawHighlightForText(font, TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(),
->>>>>>> webkit.org at r78450
!isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),
localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
#endif
@@ -827,18 +815,14 @@ void InlineTextBox::paintCompositionBackground(GraphicsContext* context, const I
int deltaY = renderer()->style()->isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
int selHeight = selectionHeight();
IntPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
-<<<<<<< HEAD
#ifdef ANDROID_DISABLE_ROUNDING_HACKS
- TextRun textRun = TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd,
+ TextRun textRun = TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(),
!isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
if (m_disableRoundingHacks)
textRun.disableRoundingHacks();
context->drawHighlightForText(font, textRun, localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
#else
- context->drawHighlightForText(font, TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd,
-=======
context->drawHighlightForText(font, TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(),
->>>>>>> webkit.org at r78450
!isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),
localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
#endif
@@ -1001,15 +985,11 @@ void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, const IntP
int deltaY = renderer()->style()->isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
int selHeight = selectionHeight();
IntPoint startPoint(boxOrigin.x(), boxOrigin.y() - deltaY);
-<<<<<<< HEAD
- TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
+ TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
#ifdef ANDROID_DISABLE_ROUNDING_HACKS
if (m_disableRoundingHacks)
run.disableRoundingHacks();
#endif
-=======
- TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
->>>>>>> webkit.org at r78450
IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, startPoint, selHeight, startPosition, endPosition));
start = markerRect.x() - startPoint.x();
@@ -1053,15 +1033,11 @@ void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, const IntPoint& bo
int sPos = max(marker.startOffset - m_start, (unsigned)0);
int ePos = min(marker.endOffset - m_start, (unsigned)m_len);
-<<<<<<< HEAD
- TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
+ TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
#ifdef ANDROID_DISABLE_ROUNDING_HACKS
if (m_disableRoundingHacks)
run.disableRoundingHacks();
#endif
-=======
- TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
->>>>>>> webkit.org at r78450
// Always compute and store the rect associated with this marker. The computed rect is in absolute coordinates.
IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, IntPoint(m_x, selectionTop()), selHeight, sPos, ePos));
@@ -1089,15 +1065,11 @@ void InlineTextBox::computeRectForReplacementMarker(const DocumentMarker& marker
int sPos = max(marker.startOffset - m_start, (unsigned)0);
int ePos = min(marker.endOffset - m_start, (unsigned)m_len);
-<<<<<<< HEAD
- TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
+ TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
#ifdef ANDROID_DISABLE_ROUNDING_HACKS
if (m_disableRoundingHacks)
run.disableRoundingHacks();
#endif
-=======
- TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
->>>>>>> webkit.org at r78450
IntPoint startPoint = IntPoint(m_x, y);
// Compute and store the rect associated with this marker.
@@ -1256,7 +1228,7 @@ int InlineTextBox::offsetForPosition(int lineOffset, bool includePartialGlyphs)
RenderStyle* style = text->style(m_firstLine);
const Font* f = &style->font();
#ifdef ANDROID_DISABLE_ROUNDING_HACKS
- TextRun textRun = TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
+ TextRun textRun = TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
if (m_disableRoundingHacks)
textRun.disableRoundingHacks();
int offset = f->offsetForPosition(textRun, lineOffset - logicalLeft(), includePartialGlyphs);
@@ -1283,20 +1255,15 @@ int InlineTextBox::positionForOffset(int offset) const
int from = !isLeftToRightDirection() ? offset - m_start : 0;
int to = !isLeftToRightDirection() ? m_len : offset - m_start;
// FIXME: Do we need to add rightBearing here?
-<<<<<<< HEAD
#ifdef ANDROID_DISABLE_ROUNDING_HACKS
- TextRun textRun = TextRun(text->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride);
+ TextRun textRun = TextRun(text->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride);
if (m_disableRoundingHacks)
textRun.disableRoundingHacks();
return enclosingIntRect(f.selectionRectForText(textRun, IntPoint(logicalLeft(), 0), 0, from, to)).right();
#else
- return enclosingIntRect(f.selectionRectForText(TextRun(text->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride),
- IntPoint(logicalLeft(), 0), 0, from, to)).right();
-#endif
-=======
return enclosingIntRect(f.selectionRectForText(TextRun(text->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride),
IntPoint(logicalLeft(), 0), 0, from, to)).maxX();
->>>>>>> webkit.org at r78450
+#endif
}
bool InlineTextBox::containsCaretOffset(int offset) const