Changeset 85143 in webkit
- Timestamp:
- Apr 27, 2011 8:20:54 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85142 r85143 1 2011-04-27 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Ryosuke Niwa. 4 5 Should have an easy way to construct starting BidiStatus for a paragraph root 6 https://bugs.webkit.org/show_bug.cgi?id=59226 7 8 Two places try to construct BidiStatuses for a paragraph root using copy/paste code. 9 I've made this a constructor for BidiStatus instead. 10 11 As part of this effort I added a direction() accessor for TextRun and got 12 rid of the old m_rtl bool. This is part of the generic effort in the 13 Bidi code to replace old bool usage with the superior TextDirection enum 14 (this generally makes the code cleaner). 15 16 As part of this replacement effort I found several places which were 17 assuming LTR (by passing rtl=false) when they probably want to use 18 the current text direction. I suspect that LTR vs. RTL may affect 19 string width in the case of ligatures. It's unclear. 20 21 This is almost entirely a mechanical change. 22 23 * html/canvas/CanvasRenderingContext2D.cpp: 24 (WebCore::CanvasRenderingContext2D::drawTextInternal): 25 * platform/graphics/GraphicsContext.cpp: 26 (WebCore::GraphicsContext::drawBidiText): 27 * platform/graphics/TextRun.h: 28 (WebCore::TextRun::TextRun): 29 (WebCore::TextRun::direction): 30 (WebCore::TextRun::rtl): 31 (WebCore::TextRun::ltr): 32 (WebCore::TextRun::setDirection): 33 * platform/text/BidiResolver.h: 34 (WebCore::BidiStatus::BidiStatus): 35 * rendering/EllipsisBox.cpp: 36 (WebCore::EllipsisBox::paint): 37 (WebCore::EllipsisBox::selectionRect): 38 (WebCore::EllipsisBox::paintSelection): 39 * rendering/InlineTextBox.cpp: 40 (WebCore::InlineTextBox::selectionRect): 41 (WebCore::InlineTextBox::paint): 42 (WebCore::InlineTextBox::paintSelection): 43 (WebCore::InlineTextBox::paintCompositionBackground): 44 (WebCore::InlineTextBox::paintSpellingOrGrammarMarker): 45 (WebCore::InlineTextBox::paintTextMatchMarker): 46 (WebCore::InlineTextBox::computeRectForReplacementMarker): 47 (WebCore::InlineTextBox::offsetForPosition): 48 (WebCore::InlineTextBox::positionForOffset): 49 * rendering/RenderBlockLineLayout.cpp: 50 (WebCore::RenderBlock::determineStartPosition): 51 * rendering/RenderFileUploadControl.cpp: 52 (WebCore::RenderFileUploadControl::paintObject): 53 (WebCore::RenderFileUploadControl::computePreferredLogicalWidths): 54 * rendering/RenderListBox.cpp: 55 (WebCore::RenderListBox::updateFromElement): 56 (WebCore::RenderListBox::paintItemForeground): 57 * rendering/RenderTextControl.cpp: 58 (WebCore::RenderTextControl::getAvgCharWidth): 59 (WebCore::RenderTextControl::paintPlaceholder): 60 * rendering/svg/SVGInlineTextBox.cpp: 61 (WebCore::SVGInlineTextBox::constructTextRun): 62 * rendering/svg/SVGTextMetrics.cpp: 63 (WebCore::constructTextRun): 64 1 65 2011-04-27 Robert Hogan <robert@webkit.org> 2 66 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r85017 r85143 1867 1867 1868 1868 RenderStyle* computedStyle = canvas()->computedStyle(); 1869 bool rtl = computedStyle ? !computedStyle->isLeftToRightDirection() : false; 1869 TextDirection direction = computedStyle ? computedStyle->direction() : LTR; 1870 bool isRTL = direction == RTL; 1870 1871 bool override = computedStyle ? computedStyle->unicodeBidi() == Override : false; 1871 1872 1872 1873 unsigned length = text.length(); 1873 1874 const UChar* string = text.characters(); 1874 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, rtl, override);1875 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, direction, override); 1875 1876 1876 1877 // Draw the item text at the correct point. … … 1894 1895 } 1895 1896 1896 float width = font.width(TextRun(text, false, 0, 0, TextRun::AllowTrailingExpansion, rtl, override));1897 float width = font.width(TextRun(text, false, 0, 0, TextRun::AllowTrailingExpansion, direction, override)); 1897 1898 1898 1899 TextAlign align = state().m_textAlign; 1899 1900 if (align == StartTextAlign) 1900 align = rtl? RightTextAlign : LeftTextAlign;1901 align = isRTL ? RightTextAlign : LeftTextAlign; 1901 1902 else if (align == EndTextAlign) 1902 align = rtl? LeftTextAlign : RightTextAlign;1903 align = isRTL ? LeftTextAlign : RightTextAlign; 1903 1904 1904 1905 switch (align) { -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp
r84342 r85143 964 964 965 965 // Prepare the directionality to draw text. 966 bool rtl = style.textDirection() == RTL; 967 TextRun textRun(itemText.characters(), itemText.length(), false, 0, 0, TextRun::AllowTrailingExpansion, rtl, style.hasTextDirectionOverride()); 966 TextRun textRun(itemText.characters(), itemText.length(), false, 0, 0, TextRun::AllowTrailingExpansion, style.textDirection(), style.hasTextDirectionOverride()); 968 967 // If the text is right-to-left, make it right-aligned by adjusting its 969 968 // beginning position. … … 1003 1002 } 1004 1003 1005 TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, TextRun::AllowTrailingExpansion, rtl, style.hasTextDirectionOverride());1004 TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, TextRun::AllowTrailingExpansion, style.textDirection(), style.hasTextDirectionOverride()); 1006 1005 if (rightAligned) 1007 1006 textX = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft()); -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r84631 r85143 399 399 return; 400 400 401 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; 402 bidiResolver.setStatus(BidiStatus(run.direction(), run.directionalOverride())); 403 bidiResolver.setPosition(TextRunIterator(&run, 0)); 404 401 405 // FIXME: This ownership should be reversed. We should pass BidiRunList 402 406 // to BidiResolver in createBidiRunsForLine. 403 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;404 407 BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs(); 405 406 WTF::Unicode::Direction paragraphDirection = run.ltr() ? WTF::Unicode::LeftToRight : WTF::Unicode::RightToLeft;407 408 bidiResolver.setStatus(BidiStatus(paragraphDirection, paragraphDirection, paragraphDirection, BidiContext::create(run.ltr() ? 0 : 1, paragraphDirection, run.directionalOverride())));409 410 bidiResolver.setPosition(TextRunIterator(&run, 0));411 408 bidiResolver.createBidiRunsForLine(TextRunIterator(&run, run.length())); 412 413 409 if (!bidiRuns.runCount()) 414 410 return; … … 417 413 BidiCharacterRun* bidiRun = bidiRuns.firstRun(); 418 414 while (bidiRun) { 419 420 415 TextRun subrun = run; 421 416 subrun.setText(run.data(bidiRun->start()), bidiRun->stop() - bidiRun->start()); 422 subrun.setRTL(bidiRun->level() % 2); 417 bool isRTL = bidiRun->level() % 2; 418 subrun.setDirection(isRTL ? RTL : LTR); 423 419 subrun.setDirectionalOverride(bidiRun->dirOverride(false)); 424 420 -
trunk/Source/WebCore/platform/graphics/TextRun.h
r82013 r85143 26 26 27 27 #include "PlatformString.h" 28 #include "TextDirection.h" 28 29 29 30 namespace WebCore { … … 43 44 typedef unsigned ExpansionBehavior; 44 45 45 TextRun(const UChar* c, int len, bool allowTabs = false, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, bool rtl = false, bool directionalOverride = false)46 TextRun(const UChar* c, int len, bool allowTabs = false, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false) 46 47 : m_characters(c) 47 48 , m_len(len) … … 53 54 #endif 54 55 , m_allowTabs(allowTabs) 55 , m_ rtl(rtl)56 , m_direction(direction) 56 57 , m_directionalOverride(directionalOverride) 57 58 , m_disableSpacing(false) … … 63 64 } 64 65 65 TextRun(const String& s, bool allowTabs = false, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, bool rtl = false, bool directionalOverride = false)66 TextRun(const String& s, bool allowTabs = false, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false) 66 67 : m_characters(s.characters()) 67 68 , m_len(s.length()) … … 73 74 #endif 74 75 , m_allowTabs(allowTabs) 75 , m_ rtl(rtl)76 , m_direction(direction) 76 77 , m_directionalOverride(directionalOverride) 77 78 , m_disableSpacing(false) … … 101 102 bool allowsLeadingExpansion() const { return m_expansionBehavior & AllowLeadingExpansion; } 102 103 bool allowsTrailingExpansion() const { return m_expansionBehavior & AllowTrailingExpansion; } 103 bool rtl() const { return m_rtl; } 104 bool ltr() const { return !m_rtl; } 104 TextDirection direction() const { return m_direction; } 105 bool rtl() const { return m_direction == RTL; } 106 bool ltr() const { return m_direction == LTR; } 105 107 bool directionalOverride() const { return m_directionalOverride; } 106 108 bool spacingDisabled() const { return m_disableSpacing; } 107 109 108 110 void disableSpacing() { m_disableSpacing = true; } 109 void set RTL(bool b) { m_rtl = b; }111 void setDirection(TextDirection direction) { m_direction = direction; } 110 112 void setDirectionalOverride(bool override) { m_directionalOverride = override; } 111 113 … … 132 134 #endif 133 135 bool m_allowTabs; 134 bool m_rtl;135 bool m_directionalOverride; 136 TextDirection m_direction; 137 bool m_directionalOverride; // Was this direction set by an override character. 136 138 bool m_disableSpacing; 137 139 -
trunk/Source/WebCore/platform/text/BidiResolver.h
r83240 r85143 25 25 #include "BidiContext.h" 26 26 #include "BidiRunList.h" 27 #include "TextDirection.h" 27 28 #include <wtf/Noncopyable.h> 28 29 #include <wtf/PassRefPtr.h> … … 61 62 , last(WTF::Unicode::OtherNeutral) 62 63 { 64 } 65 66 // Creates a BidiStatus representing a new paragraph root with a default direction. 67 // Uses TextDirection as it only has two possibilities instead of WTF::Unicode::Direction which has 19. 68 BidiStatus(TextDirection textDirection, bool isOverride) 69 { 70 WTF::Unicode::Direction direction = textDirection == LTR ? WTF::Unicode::LeftToRight : WTF::Unicode::RightToLeft; 71 eor = lastStrong = last = direction; 72 context = BidiContext::create(textDirection == LTR ? 0 : 1, direction, isOverride); 63 73 } 64 74 -
trunk/Source/WebCore/platform/win/PopupMenuWin.cpp
r78846 r85143 632 632 unsigned length = itemText.length(); 633 633 const UChar* string = itemText.characters(); 634 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, itemText.defaultWritingDirection() == WTF::Unicode::RightToLeft); 634 TextDirection direction = (itemText.defaultWritingDirection() == WTF::Unicode::RightToLeft) ? RTL : LTR; 635 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, direction); 635 636 636 637 context.setFillColor(optionTextColor, ColorSpaceDeviceRGB); -
trunk/Source/WebCore/rendering/EllipsisBox.cpp
r84504 r85143 54 54 55 55 const String& str = m_str; 56 context->drawText(style->font(), TextRun(str.characters(), str.length(), false, 0, 0, TextRun::AllowTrailingExpansion, false, style->visuallyOrdered()), IntPoint(m_x + tx, m_y + ty + style->fontMetrics().ascent())); 56 // FIXME: Why is this alwasy LTR? 57 context->drawText(style->font(), TextRun(str.characters(), str.length(), false, 0, 0, TextRun::AllowTrailingExpansion, LTR, style->visuallyOrdered()), IntPoint(m_x + tx, m_y + ty + style->fontMetrics().ascent())); 57 58 58 59 // Restore the regular fill color. … … 75 76 RenderStyle* style = m_renderer->style(m_firstLine); 76 77 const Font& f = style->font(); 77 return enclosingIntRect(f.selectionRectForText(TextRun(m_str.characters(), m_str.length(), false, 0, 0, TextRun::AllowTrailingExpansion, false, style->visuallyOrdered()), 78 // FIXME: Why is this always LTR? 79 return enclosingIntRect(f.selectionRectForText(TextRun(m_str.characters(), m_str.length(), false, 0, 0, TextRun::AllowTrailingExpansion, LTR, style->visuallyOrdered()), 78 80 IntPoint(m_x + tx, m_y + ty + root()->selectionTop()), root()->selectionHeight())); 79 81 } … … 95 97 int h = root()->selectionHeight(); 96 98 context->clip(IntRect(m_x + tx, y + ty, m_logicalWidth, h)); 97 context->drawHighlightForText(font, TextRun(m_str.characters(), m_str.length(), false, 0, 0, TextRun::AllowTrailingExpansion, false, style->visuallyOrdered()), 99 // FIXME: Why is this always LTR? 100 context->drawHighlightForText(font, TextRun(m_str.characters(), m_str.length(), false, 0, 0, TextRun::AllowTrailingExpansion, LTR, style->visuallyOrdered()), 98 101 IntPoint(m_x + tx, m_y + ty + y), h, c, style->colorSpace()); 99 102 } -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r84956 r85143 194 194 } 195 195 196 IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_expansion, expansionBehavior(), !isLeftToRightDirection(), m_dirOverride),196 IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride), 197 197 IntPoint(), selHeight, sPos, ePos)); 198 198 … … 651 651 adjustCharactersAndLengthForHyphen(charactersWithHyphen, styleToUse, characters, length); 652 652 653 TextRun textRun(characters, length, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), !isLeftToRightDirection(), m_dirOverride || styleToUse->visuallyOrdered());653 TextRun textRun(characters, length, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride || styleToUse->visuallyOrdered()); 654 654 655 655 int sPos = 0; … … 820 820 context->clip(FloatRect(localOrigin, FloatSize(m_logicalWidth, selHeight))); 821 821 context->drawHighlightForText(font, TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), 822 !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),822 direction(), m_dirOverride || style->visuallyOrdered()), 823 823 localOrigin, selHeight, c, style->colorSpace(), sPos, ePos); 824 824 } … … 843 843 FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); 844 844 context->drawHighlightForText(font, TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), 845 !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),845 direction(), m_dirOverride || style->visuallyOrdered()), 846 846 localOrigin, selHeight, c, style->colorSpace(), sPos, ePos); 847 847 } … … 1002 1002 int selHeight = selectionHeight(); 1003 1003 FloatPoint startPoint(boxOrigin.x(), boxOrigin.y() - deltaY); 1004 TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());1004 TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride || style->visuallyOrdered()); 1005 1005 1006 1006 // FIXME: Convert the document markers to float rects. … … 1047 1047 int sPos = max(marker.startOffset - m_start, (unsigned)0); 1048 1048 int ePos = min(marker.endOffset - m_start, (unsigned)m_len); 1049 TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());1049 TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride || style->visuallyOrdered()); 1050 1050 1051 1051 // Always compute and store the rect associated with this marker. The computed rect is in absolute coordinates. … … 1074 1074 int sPos = max(marker.startOffset - m_start, (unsigned)0); 1075 1075 int ePos = min(marker.endOffset - m_start, (unsigned)m_len); 1076 TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());1076 TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride || style->visuallyOrdered()); 1077 1077 IntPoint startPoint = IntPoint(m_x, y); 1078 1078 … … 1235 1235 const Font* f = &style->font(); 1236 1236 int offset = f->offsetForPosition(TextRun(textRenderer()->text()->characters() + m_start, m_len, 1237 textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),1237 textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride || style->visuallyOrdered()), 1238 1238 lineOffset - logicalLeft(), includePartialGlyphs); 1239 1239 if (blockIsInOppositeDirection && (!offset || offset == m_len)) … … 1255 1255 int to = !isLeftToRightDirection() ? m_len : offset - m_start; 1256 1256 // FIXME: Do we need to add rightBearing here? 1257 return f.selectionRectForText(TextRun(text->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), !isLeftToRightDirection(), m_dirOverride),1257 return f.selectionRectForText(TextRun(text->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride), 1258 1258 IntPoint(logicalLeft(), 0), 0, from, to).maxX(); 1259 1259 } -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r84436 r85143 1260 1260 previousLineBrokeCleanly = !last || last->endsWithBreak(); 1261 1261 1262 RenderObject* startObj;1263 int pos = 0;1264 1262 if (last) { 1265 1263 setLogicalHeight(last->blockLogicalHeight()); 1266 startObj = last->lineBreakObj(); 1267 pos = last->lineBreakPos(); 1264 resolver.setPosition(InlineIterator(this, last->lineBreakObj(), last->lineBreakPos())); 1268 1265 resolver.setStatus(last->lineBreakBidiStatus()); 1269 1266 } else { 1270 bool ltr = style()->isLeftToRightDirection(); 1271 Direction direction = ltr ? LeftToRight : RightToLeft; 1272 resolver.setLastStrongDir(direction); 1273 resolver.setLastDir(direction); 1274 resolver.setEorDir(direction); 1275 resolver.setContext(BidiContext::create(ltr ? 0 : 1, direction, style()->unicodeBidi() == Override, FromStyleOrDOM)); 1276 1277 startObj = bidiFirstSkippingInlines(this, &resolver); 1278 } 1279 1280 resolver.setPosition(InlineIterator(this, startObj, pos)); 1281 1267 resolver.setStatus(BidiStatus(style()->direction(), style()->unicodeBidi() == Override)); 1268 resolver.setPosition(InlineIterator(this, bidiFirstSkippingInlines(this, &resolver), 0)); 1269 } 1282 1270 return curr; 1283 1271 } -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r84504 r85143 224 224 unsigned length = displayedFilename.length(); 225 225 const UChar* string = displayedFilename.characters(); 226 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, !style()->isLeftToRightDirection(), style()->unicodeBidi() == Override);226 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, style()->direction(), style()->unicodeBidi() == Override); 227 227 228 228 // Determine where the filename should be placed … … 277 277 // (using "0" as the nominal character). 278 278 const UChar ch = '0'; 279 float charWidth = style()->font().width(TextRun(&ch, 1, false, 0, 0, TextRun::AllowTrailingExpansion , false));279 float charWidth = style()->font().width(TextRun(&ch, 1, false, 0, 0, TextRun::AllowTrailingExpansion)); 280 280 m_maxPreferredLogicalWidth = (int)ceilf(charWidth * defaultWidthNumChars); 281 281 } -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r84214 r85143 116 116 itemFont.update(document()->styleSelector()->fontSelector()); 117 117 } 118 118 119 119 if (!text.isEmpty()) { 120 float textWidth = itemFont.width(TextRun(text.impl(), false, 0, 0, TextRun::AllowTrailingExpansion, false, false)); 120 // FIXME: Why is this always LTR? Can't text direction affect the width? 121 float textWidth = itemFont.width(TextRun(text.impl(), false, 0, 0, TextRun::AllowTrailingExpansion, LTR)); 121 122 width = max(width, textWidth); 122 123 } … … 390 391 unsigned length = itemText.length(); 391 392 const UChar* string = itemText.characters(); 392 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, !itemStyle->isLeftToRightDirection(), itemStyle->unicodeBidi() == Override);393 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), itemStyle->unicodeBidi() == Override); 393 394 Font itemFont = style()->font(); 394 395 IntRect r = itemBoundingBoxRect(tx, ty, listIndex); -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r84504 r85143 542 542 return roundf(style()->font().primaryFont()->avgCharWidth()); 543 543 544 const UChar ch = '0'; 545 return style()->font().width(TextRun(&ch, 1, false, 0, 0, TextRun::AllowTrailingExpansion , false));544 const UChar ch = '0'; 545 return style()->font().width(TextRun(&ch, 1, false, 0, 0, TextRun::AllowTrailingExpansion)); 546 546 } 547 547 … … 637 637 638 638 String placeholderText = static_cast<HTMLTextFormControlElement*>(node())->strippedPlaceholder(); 639 TextRun textRun(placeholderText.characters(), placeholderText.length(), false, 0, 0, TextRun::AllowTrailingExpansion, !placeholderStyle->isLeftToRightDirection(), placeholderStyle->unicodeBidi() == Override);639 TextRun textRun(placeholderText.characters(), placeholderText.length(), false, 0, 0, TextRun::AllowTrailingExpansion, placeholderStyle->direction(), placeholderStyle->unicodeBidi() == Override); 640 640 641 641 RenderBox* textRenderer = innerTextElement() ? innerTextElement()->renderBox() : 0; -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
r84504 r85143 413 413 , 0 /* padding, only relevant for justified text, not relevant for SVG */ 414 414 , TextRun::AllowTrailingExpansion 415 , direction() == RTL415 , direction() 416 416 , m_dirOverride || style->visuallyOrdered() /* directionalOverride */); 417 417 -
trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
r81168 r85143 84 84 , 0 /* padding, only relevant for justified text, not relevant for SVG */ 85 85 , TextRun::AllowTrailingExpansion 86 , !style->isLeftToRightDirection()86 , style->direction() 87 87 , style->unicodeBidi() == Override /* directionalOverride */); 88 88 -
trunk/Source/WebKit/chromium/src/WebTextRun.cpp
r76743 r85143 40 40 WebTextRun::operator WebCore::TextRun() const 41 41 { 42 return TextRun(text, false, 0, 0, TextRun::AllowTrailingExpansion, rtl , directionalOverride);42 return TextRun(text, false, 0, 0, TextRun::AllowTrailingExpansion, rtl ? RTL : LTR, directionalOverride); 43 43 } 44 44 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
r82442 r85143 117 117 unsigned length = itemText.length(); 118 118 const UChar* string = itemText.characters(); 119 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, itemText.defaultWritingDirection() == WTF::Unicode::RightToLeft); 119 // FIXME: defaultWritingDirection should return a TextDirection not a Unicode::Direction. 120 TextDirection direction = itemText.defaultWritingDirection() == WTF::Unicode::RightToLeft ? RTL : LTR; 121 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, direction); 120 122 121 123 notSelectedBackingStoreContext->setFillColor(optionTextColor, ColorSpaceDeviceRGB);
Note: See TracChangeset
for help on using the changeset viewer.