Changeset 89733 in webkit
- Timestamp:
- Jun 24, 2011 11:49:12 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 51 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89732 r89733 1 2011-06-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Add an option to enable legacy rounding hacks 6 https://bugs.webkit.org/show_bug.cgi?id=63363 7 8 * platform/mac/fast/text/rounding-hacks.html: Added. 9 * platform/mac/platform/mac/fast/text/rounding-hacks-expected.png: Added. 10 * platform/mac/platform/mac/fast/text/rounding-hacks-expected.txt: Added. 11 1 12 2011-06-24 Nikolas Zimmermann <nzimmermann@rim.com> 2 13 -
trunk/Source/WebCore/CMakeLists.txt
r89731 r89733 1088 1088 platform/graphics/StringTruncator.cpp 1089 1089 platform/graphics/SurrogatePairAwareTextIterator.cpp 1090 platform/graphics/TextRun.cpp 1090 1091 platform/graphics/WidthIterator.cpp 1091 1092 -
trunk/Source/WebCore/ChangeLog
r89732 r89733 1 2011-06-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Add an option to enable legacy rounding hacks 6 https://bugs.webkit.org/show_bug.cgi?id=63363 7 8 Restored most of text rounding hacks which were removed in r78846, with a global flag to control 9 whether rounding hacks are allowed, which defaults to false. 10 11 Test: platform/mac/fast/text/rounding-hacks.html 12 13 * CMakeLists.txt: Added TextRun.cpp. 14 * GNUmakefile.list.am: Ditto. 15 * WebCore.exp.in: Export new TextRun function and global and updated StringTruncator functions. 16 * WebCore.gypi: Added TextRun.cpp. 17 * WebCore.pro: Ditto. 18 * WebCore.vcproj/WebCore.vcproj: Ditto. 19 * WebCore.xcodeproj/project.pbxproj: Ditto. 20 * html/canvas/CanvasRenderingContext2D.cpp: 21 (WebCore::CanvasRenderingContext2D::drawTextInternal): Disable rounding hacks in the one place 22 they used to be disabled. 23 * platform/graphics/Font.cpp: Re-added the rounding character table. 24 * platform/graphics/Font.h: 25 (WebCore::Font::isRoundingHackCharacter): Re-added. 26 * platform/graphics/FontFastPath.cpp: 27 (WebCore::Font::getGlyphsAndAdvancesForSimpleText): Account for final rounding width. 28 * platform/graphics/SimpleFontData.cpp: 29 (WebCore::SimpleFontData::platformGlyphInit): Initialize m_adjustedSpaceWidth. 30 * platform/graphics/SimpleFontData.h: 31 (WebCore::SimpleFontData::adjustedSpaceWidth): Re-added. 32 * platform/graphics/StringTruncator.cpp: 33 (WebCore::stringWidth): Re-added disableRoundingHacks parameter. 34 (WebCore::truncateString): Ditto. 35 (WebCore::StringTruncator::centerTruncate): Added EnableRoundingHacksOrNot parameter. 36 (WebCore::StringTruncator::rightTruncate): Ditto. 37 (WebCore::StringTruncator::width): Ditto. 38 * platform/graphics/StringTruncator.h: 39 * platform/graphics/TextRun.cpp: Added. 40 (WebCore::TextRun::setAllowsRoundingHacks): Added. 41 * platform/graphics/TextRun.h: 42 (WebCore::TextRun::TextRun): Added RoundingHacks parameter to the constructors, used to initialize 43 the m_applyRunRounding and m_applyWordRounding member variables, subject to rounding hacks being allowed. 44 (WebCore::TextRun::applyRunRounding): Re-added this accessor. 45 (WebCore::TextRun::applyWordRounding): Ditto. 46 (WebCore::TextRun::disableRoundingHacks): Re-added. 47 * platform/graphics/WidthIterator.cpp: 48 (WebCore::WidthIterator::WidthIterator): Re-added code to apply rounding hacks. 49 (WebCore::WidthIterator::advance): Ditto. 50 * platform/graphics/WidthIterator.h: 51 * platform/graphics/mac/ComplexTextController.cpp: 52 (WebCore::ceilCGFloat): Re-added. 53 (WebCore::ComplexTextController::ComplexTextController): Re-added code to apply rounding hacks. 54 (WebCore::ComplexTextController::advance): Ditto. 55 (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Ditto. 56 * platform/graphics/mac/ComplexTextController.h: 57 (WebCore::ComplexTextController::finalRoundingWidth): Re-added this accessor. 58 * platform/graphics/mac/FontComplexTextMac.cpp: 59 (WebCore::Font::getGlyphsAndAdvancesForComplexText): Accound for final rounding width. 60 * platform/graphics/qt/SimpleFontDataQt.cpp: 61 (WebCore::SimpleFontData::platformGlyphInit): Initialize m_adjustedSpaceWidth. 62 * platform/gtk/RenderThemeGtk.cpp: 63 (WebCore::RenderThemeGtk::fileListNameForWidth): Enabled rounding hacks in the string truncator. 64 * platform/mac/DragImageMac.mm: 65 (WebCore::widthWithFont): Disable rounding hacks when measuring. 66 (WebCore::drawAtPoint): Disable rounding hacks when drawing. 67 * platform/win/DragImageWin.cpp: 68 (WebCore::createDragImageForLink): Enable rounding hacks in the string truncator. 69 * platform/win/WebCoreTextRenderer.cpp: 70 (WebCore::WebCoreTextFloatWidth): Ditto. 71 * rendering/RenderFileUploadControl.cpp: 72 (WebCore::RenderFileUploadControl::paintObject): Disable rounding hacks. 73 * rendering/RenderListBox.cpp: 74 (WebCore::RenderListBox::updateFromElement): Ditto. 75 (WebCore::RenderListBox::paintItemForeground): Ditto. 76 * rendering/RenderTextControl.cpp: 77 (WebCore::RenderTextControl::getAvgCharWidth): Ditto. 78 * rendering/RenderTheme.cpp: 79 (WebCore::RenderTheme::fileListNameForWidth): Enabled rounding hacks in the string truncator. 80 * rendering/RenderThemeMac.mm: 81 (WebCore::RenderThemeMac::fileListNameForWidth): Ditto. 82 * rendering/svg/SVGInlineTextBox.cpp: 83 (WebCore::SVGInlineTextBox::constructTextRun): Disabled rounding hacks. 84 * rendering/svg/SVGTextMetrics.cpp: 85 (WebCore::constructTextRun): Ditto. 86 1 87 2011-06-24 Nikolas Zimmermann <nzimmermann@rim.com> 2 88 -
trunk/Source/WebCore/GNUmakefile.list.am
r89711 r89733 2562 2562 Source/WebCore/platform/graphics/SVGGlyph.h \ 2563 2563 Source/WebCore/platform/graphics/TextRenderingMode.h \ 2564 Source/WebCore/platform/graphics/TextRun.cpp \ 2564 2565 Source/WebCore/platform/graphics/TextRun.h \ 2565 2566 Source/WebCore/platform/graphics/transforms/AffineTransform.cpp \ -
trunk/Source/WebCore/WebCore.exp.in
r89682 r89733 430 430 __ZN7WebCore15ScrollAlignment17alignCenterAlwaysE 431 431 __ZN7WebCore15ScrollAlignment19alignToEdgeIfNeededE 432 __ZN7WebCore15StringTruncator13rightTruncateERKN3WTF6StringEfRKNS_4FontE 433 __ZN7WebCore15StringTruncator14centerTruncateERKN3WTF6StringEfRKNS_4FontE 434 __ZN7WebCore15StringTruncator5widthERKN3WTF6StringERKNS_4FontE 432 __ZN7WebCore15StringTruncator13rightTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotE 433 __ZN7WebCore15StringTruncator14centerTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotE 434 __ZN7WebCore15StringTruncator5widthERKN3WTF6StringERKNS_4FontENS0_24EnableRoundingHacksOrNotE 435 435 __ZN7WebCore15VisiblePositionC1ERKNS_8PositionENS_9EAffinityE 436 436 __ZN7WebCore15defaultLanguageEv … … 827 827 __ZN7WebCore7IntRectC1ERKNS_9FloatRectE 828 828 __ZN7WebCore7IntSizeC1ERK7_NSSize 829 __ZN7WebCore7TextRun21s_allowsRoundingHacksE 830 __ZN7WebCore7TextRun22setAllowsRoundingHacksEb 829 831 __ZN7WebCore7cookiesEPKNS_8DocumentERKNS_4KURLE 830 832 __ZN7WebCore7nsColorERKNS_5ColorE -
trunk/Source/WebCore/WebCore.gypi
r89711 r89733 3985 3985 'platform/graphics/SurrogatePairAwareTextIterator.cpp', 3986 3986 'platform/graphics/SurrogatePairAwareTextIterator.h', 3987 'platform/graphics/TextRun.cpp', 3987 3988 'platform/graphics/Tile.h', 3988 3989 'platform/graphics/TiledBackingStore.cpp', -
trunk/Source/WebCore/WebCore.pro
r89711 r89733 1008 1008 platform/graphics/SimpleFontData.cpp \ 1009 1009 platform/graphics/StringTruncator.cpp \ 1010 platform/graphics/TextRun.cpp \ 1010 1011 platform/graphics/TiledBackingStore.cpp \ 1011 1012 platform/graphics/transforms/AffineTransform.cpp \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r89690 r89733 27690 27690 </File> 27691 27691 <File 27692 RelativePath="..\platform\graphics\TextRun.cpp" 27693 > 27694 </File> 27695 <File 27692 27696 RelativePath="..\platform\graphics\TextRun.h" 27693 27697 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r89711 r89733 809 809 375CD232119D43C800A2A859 /* Hyphenation.h in Headers */ = {isa = PBXBuildFile; fileRef = 375CD231119D43C800A2A859 /* Hyphenation.h */; }; 810 810 375CD23B119D44EA00A2A859 /* HyphenationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 375CD239119D44EA00A2A859 /* HyphenationMac.mm */; }; 811 376DCCE113B4F966002EBEFC /* TextRun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 376DCCE013B4F966002EBEFC /* TextRun.cpp */; }; 811 812 3774ABA50FA21EB400AD7DE9 /* OverlapTestRequestClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 812 813 377C4CDF1014E9F600B9AE42 /* PlaceholderDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 377C4CDD1014E9F600B9AE42 /* PlaceholderDocument.h */; }; … … 7259 7260 375CD231119D43C800A2A859 /* Hyphenation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Hyphenation.h; sourceTree = "<group>"; }; 7260 7261 375CD239119D44EA00A2A859 /* HyphenationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HyphenationMac.mm; sourceTree = "<group>"; }; 7262 376DCCE013B4F966002EBEFC /* TextRun.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextRun.cpp; sourceTree = "<group>"; }; 7261 7263 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlapTestRequestClient.h; sourceTree = "<group>"; }; 7262 7264 377C4CDD1014E9F600B9AE42 /* PlaceholderDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaceholderDocument.h; sourceTree = "<group>"; }; … … 18045 18047 930FC6891072B9280045293E /* TextRenderingMode.h */, 18046 18048 A824B4640E2EF2EA0081A7B7 /* TextRun.h */, 18049 376DCCE013B4F966002EBEFC /* TextRun.cpp */, 18047 18050 37C28A6710F659CC008C7813 /* TypesettingFeatures.h */, 18048 18051 E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */, … … 25816 25819 43A6266713B3D11000AC94B8 /* SVGAnimatedString.cpp in Sources */, 25817 25820 087558C513B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp in Sources */, 25821 376DCCE113B4F966002EBEFC /* TextRun.cpp in Sources */, 25818 25822 ); 25819 25823 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r89283 r89733 1926 1926 unsigned length = text.length(); 1927 1927 const UChar* string = text.characters(); 1928 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, direction, override );1928 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, direction, override, TextRun::NoRounding); 1929 1929 1930 1930 // Draw the item text at the correct point. -
trunk/Source/WebCore/platform/graphics/Font.cpp
r89732 r89733 42 42 43 43 namespace WebCore { 44 45 const uint8_t Font::s_roundingHackCharacterTable[256] = { 46 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*\t*/, 1 /*\n*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47 1 /*space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*-*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*?*/, 48 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51 1 /*no-break space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 54 }; 44 55 45 56 Font::CodePath Font::s_codePath = Auto; -
trunk/Source/WebCore/platform/graphics/Font.h
r89732 r89733 195 195 static CodePath s_codePath; 196 196 197 static const uint8_t s_roundingHackCharacterTable[256]; 198 static bool isRoundingHackCharacter(UChar32 c) 199 { 200 return !(c & ~0xFF) && s_roundingHackCharacterTable[c]; 201 } 202 197 203 FontSelector* fontSelector() const; 198 204 static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == noBreakSpace; } -
trunk/Source/WebCore/platform/graphics/FontFastPath.cpp
r89732 r89733 338 338 339 339 if (run.rtl()) { 340 float finalRoundingWidth = it.m_finalRoundingWidth; 340 341 it.advance(run.length()); 341 initialAdvance = it.m_runWidthSoFar - afterWidth;342 initialAdvance = finalRoundingWidth + it.m_runWidthSoFar - afterWidth; 342 343 } else 343 344 initialAdvance = beforeWidth; -
trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp
r89732 r89733 99 99 m_spaceGlyph = 0; 100 100 m_spaceWidth = 0; 101 m_adjustedSpaceWidth = 0; 101 102 determinePitch(); 102 103 m_zeroWidthSpaceGlyph = 0; … … 115 116 m_spaceWidth = width; 116 117 determinePitch(); 118 m_adjustedSpaceWidth = m_treatAsFixedPitch ? ceilf(width) : roundf(width); 117 119 118 120 // Force the glyph for ZERO WIDTH SPACE to have zero width, unless it is shared with SPACE. -
trunk/Source/WebCore/platform/graphics/SimpleFontData.h
r89732 r89733 135 135 136 136 float spaceWidth() const { return m_spaceWidth; } 137 float adjustedSpaceWidth() const { return m_adjustedSpaceWidth; } 137 138 void setSpaceWidth(float spaceWidth) { m_spaceWidth = spaceWidth; } 138 139 … … 244 245 Glyph m_spaceGlyph; 245 246 float m_spaceWidth; 247 float m_adjustedSpaceWidth; 246 248 247 249 Glyph m_zeroWidthSpaceGlyph; -
trunk/Source/WebCore/platform/graphics/StringTruncator.cpp
r78846 r89733 93 93 } 94 94 95 static float stringWidth(const Font& renderer, const UChar* characters, unsigned length )95 static float stringWidth(const Font& renderer, const UChar* characters, unsigned length, bool disableRoundingHacks) 96 96 { 97 97 TextRun run(characters, length); 98 if (disableRoundingHacks) 99 run.disableRoundingHacks(); 98 100 return renderer.width(run); 99 101 } 100 102 101 static String truncateString(const String& string, float maxWidth, const Font& font, TruncationFunction truncateToBuffer )103 static String truncateString(const String& string, float maxWidth, const Font& font, TruncationFunction truncateToBuffer, bool disableRoundingHacks) 102 104 { 103 105 if (string.isEmpty()) … … 106 108 ASSERT(maxWidth >= 0); 107 109 108 float currentEllipsisWidth = stringWidth(font, &horizontalEllipsis, 1 );110 float currentEllipsisWidth = stringWidth(font, &horizontalEllipsis, 1, disableRoundingHacks); 109 111 110 112 UChar stringBuffer[STRING_BUFFER_SIZE]; … … 122 124 } 123 125 124 float width = stringWidth(font, stringBuffer, truncatedLength );126 float width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks); 125 127 if (width <= maxWidth) 126 128 return string; … … 158 160 truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer); 159 161 160 width = stringWidth(font, stringBuffer, truncatedLength );162 width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks); 161 163 if (width <= maxWidth) { 162 164 keepCountForLargestKnownToFit = keepCount; … … 180 182 } 181 183 182 String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font& font )184 String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks) 183 185 { 184 return truncateString(string, maxWidth, font, centerTruncateToBuffer );186 return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks); 185 187 } 186 188 187 String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font& font )189 String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks) 188 190 { 189 return truncateString(string, maxWidth, font, rightTruncateToBuffer );191 return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks); 190 192 } 191 193 192 float StringTruncator::width(const String& string, const Font& font )194 float StringTruncator::width(const String& string, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks) 193 195 { 194 return stringWidth(font, string.characters(), string.length() );196 return stringWidth(font, string.characters(), string.length(), !enableRoundingHacks); 195 197 } 196 198 -
trunk/Source/WebCore/platform/graphics/StringTruncator.h
r78846 r89733 38 38 class StringTruncator { 39 39 public: 40 static String centerTruncate(const String&, float maxWidth, const Font&); 41 static String rightTruncate(const String&, float maxWidth, const Font&); 42 static float width(const String&, const Font&); 40 enum EnableRoundingHacksOrNot { DisableRoundingHacks, EnableRoundingHacks }; 41 42 static String centerTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks); 43 static String rightTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks); 44 static float width(const String&, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks); 43 45 }; 44 46 -
trunk/Source/WebCore/platform/graphics/TextRun.h
r89732 r89733 51 51 typedef unsigned ExpansionBehavior; 52 52 53 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) 53 enum RoundingHackFlags { 54 NoRounding = 0, 55 RunRounding = 1 << 0, 56 WordRounding = 1 << 1, 57 }; 58 59 typedef unsigned RoundingHacks; 60 61 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, RoundingHacks roundingHacks = RunRounding | WordRounding) 54 62 : m_characters(c) 55 63 , m_charactersLength(len) … … 64 72 , m_direction(direction) 65 73 , m_directionalOverride(directionalOverride) 74 , m_applyRunRounding((roundingHacks & RunRounding) && s_allowsRoundingHacks) 75 , m_applyWordRounding((roundingHacks & WordRounding) && s_allowsRoundingHacks) 66 76 , m_disableSpacing(false) 67 77 { 68 78 } 69 79 70 TextRun(const String& s, bool allowTabs = false, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false )80 TextRun(const String& s, bool allowTabs = false, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, RoundingHacks roundingHacks = RunRounding | WordRounding) 71 81 : m_characters(s.characters()) 72 82 , m_charactersLength(s.length()) … … 81 91 , m_direction(direction) 82 92 , m_directionalOverride(directionalOverride) 93 , m_applyRunRounding((roundingHacks & RunRounding) && s_allowsRoundingHacks) 94 , m_applyWordRounding((roundingHacks & WordRounding) && s_allowsRoundingHacks) 83 95 , m_disableSpacing(false) 84 96 { … … 111 123 bool ltr() const { return m_direction == LTR; } 112 124 bool directionalOverride() const { return m_directionalOverride; } 125 bool applyRunRounding() const { return m_applyRunRounding; } 126 bool applyWordRounding() const { return m_applyWordRounding; } 113 127 bool spacingDisabled() const { return m_disableSpacing; } 114 128 115 129 void disableSpacing() { m_disableSpacing = true; } 130 void disableRoundingHacks() { m_applyRunRounding = m_applyWordRounding = false; } 116 131 void setDirection(TextDirection direction) { m_direction = direction; } 117 132 void setDirectionalOverride(bool override) { m_directionalOverride = override; } … … 131 146 void setRenderingContext(PassRefPtr<RenderingContext> context) { m_renderingContext = context; } 132 147 148 static void setAllowsRoundingHacks(bool); 149 133 150 private: 151 static bool s_allowsRoundingHacks; 152 134 153 const UChar* m_characters; 135 154 int m_charactersLength; // Marks the end of the m_characters buffer. Default equals to m_len. … … 148 167 TextDirection m_direction; 149 168 bool m_directionalOverride; // Was this direction set by an override character. 169 bool m_applyRunRounding; 170 bool m_applyWordRounding; 150 171 bool m_disableSpacing; 151 172 RefPtr<RenderingContext> m_renderingContext; -
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp
r89732 r89733 42 42 , m_runWidthSoFar(0) 43 43 , m_isAfterExpansion(!run.allowsLeadingExpansion()) 44 , m_finalRoundingWidth(0) 44 45 , m_fallbackFonts(fallbackFonts) 45 46 , m_accountForGlyphBounds(accountForGlyphBounds) … … 94 95 bool hasExtraSpacing = (m_font->letterSpacing() || m_font->wordSpacing() || m_expansion) && !m_run.spacingDisabled(); 95 96 97 float widthSinceLastRounding = m_runWidthSoFar; 98 m_runWidthSoFar = floorf(m_runWidthSoFar); 99 widthSinceLastRounding -= m_runWidthSoFar; 100 101 float lastRoundingWidth = m_finalRoundingWidth; 96 102 FloatRect bounds; 97 103 … … 114 120 if (character == '\t' && m_run.allowTabs()) { 115 121 float tabWidth = m_font->tabWidth(*fontData); 116 width = tabWidth - fmodf(m_run.xPos() + m_runWidthSoFar , tabWidth);122 width = tabWidth - fmodf(m_run.xPos() + m_runWidthSoFar + widthSinceLastRounding, tabWidth); 117 123 } else { 118 124 width = fontData->widthForGlyph(glyph); … … 122 128 width *= m_run.horizontalGlyphStretch(); 123 129 #endif 130 131 // We special case spaces in two ways when applying word rounding. 132 // First, we round spaces to an adjusted width in all fonts. 133 // Second, in fixed-pitch fonts we ensure that all characters that 134 // match the width of the space character have the same width as the space character. 135 if (m_run.applyWordRounding() && width == fontData->spaceWidth() && (fontData->pitch() == FixedPitch || glyph == fontData->spaceGlyph())) 136 width = fontData->adjustedSpaceWidth(); 124 137 } 125 138 … … 188 201 // Advance past the character we just dealt with. 189 202 textIterator.advance(advanceLength); 190 m_runWidthSoFar += width; 203 204 float oldWidth = width; 205 206 // Force characters that are used to determine word boundaries for the rounding hack 207 // to be integer width, so following words will start on an integer boundary. 208 if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(character)) { 209 width = ceilf(width); 210 211 // Since widthSinceLastRounding can lose precision if we include measurements for 212 // preceding whitespace, we bypass it here. 213 m_runWidthSoFar += width; 214 215 // Since this is a rounding hack character, we should have reset this sum on the previous 216 // iteration. 217 ASSERT(!widthSinceLastRounding); 218 } else { 219 // Check to see if the next character is a "rounding hack character", if so, adjust 220 // width so that the total run width will be on an integer boundary. 221 if ((m_run.applyWordRounding() && textIterator.currentCharacter() < m_run.length() && Font::isRoundingHackCharacter(*(textIterator.characters()))) 222 || (m_run.applyRunRounding() && textIterator.currentCharacter() >= m_run.length())) { 223 float totalWidth = widthSinceLastRounding + width; 224 widthSinceLastRounding = ceilf(totalWidth); 225 width += widthSinceLastRounding - totalWidth; 226 m_runWidthSoFar += widthSinceLastRounding; 227 widthSinceLastRounding = 0; 228 } else 229 widthSinceLastRounding += width; 230 } 191 231 192 232 if (glyphBuffer) 193 glyphBuffer->add(glyph, fontData, width); 233 glyphBuffer->add(glyph, fontData, (rtl ? oldWidth + lastRoundingWidth : width)); 234 235 lastRoundingWidth = width - oldWidth; 194 236 195 237 if (m_accountForGlyphBounds) { … … 202 244 unsigned consumedCharacters = textIterator.currentCharacter() - m_currentCharacter; 203 245 m_currentCharacter = textIterator.currentCharacter(); 246 m_runWidthSoFar += widthSinceLastRounding; 247 m_finalRoundingWidth = lastRoundingWidth; 204 248 return consumedCharacters; 205 249 } -
trunk/Source/WebCore/platform/graphics/WidthIterator.h
r89732 r89733 65 65 float m_expansionPerOpportunity; 66 66 bool m_isAfterExpansion; 67 float m_finalRoundingWidth; 67 68 68 69 #if ENABLE(SVG_FONTS) -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
r88478 r89733 50 50 } 51 51 52 static inline CGFloat ceilCGFloat(CGFloat f) 53 { 54 if (sizeof(CGFloat) == sizeof(float)) 55 return ceilf(static_cast<float>(f)); 56 return static_cast<CGFloat>(ceil(f)); 57 } 58 52 59 ComplexTextController::ComplexTextController(const Font* font, const TextRun& run, bool mayUseNaturalWritingDirection, HashSet<const SimpleFontData*>* fallbackFonts, bool forTextEmphasis) 53 60 : m_font(*font) … … 63 70 , m_glyphInCurrentRun(0) 64 71 , m_characterInCurrentGlyph(0) 72 , m_finalRoundingWidth(0) 65 73 , m_expansion(run.expansion()) 66 74 , m_leadingExpansion(0) … … 71 79 , m_minGlyphBoundingBoxY(numeric_limits<float>::max()) 72 80 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min()) 81 , m_lastRoundingGlyph(0) 73 82 { 74 83 if (!m_expansion) … … 401 410 m_glyphInCurrentRun = 0; 402 411 } 412 if (!ltr && m_numGlyphsSoFar == m_adjustedAdvances.size()) 413 m_runWidthSoFar += m_finalRoundingWidth; 403 414 } 404 415 … … 418 429 bool lastRun = r + 1 == runCount; 419 430 bool roundsAdvances = !m_font.isPrinterFont() && fontData->platformData().roundsGlyphAdvances(); 431 CGFloat roundedSpaceWidth = roundCGFloat(fontData->spaceWidth()); 420 432 const UChar* cp = complexTextRun.characters(); 421 433 CGPoint glyphOrigin = CGPointZero; … … 459 471 460 472 advance.width += fontData->syntheticBoldOffset(); 473 474 475 // We special case spaces in two ways when applying word rounding. 476 // First, we round spaces to an adjusted width in all fonts. 477 // Second, in fixed-pitch fonts we ensure that all glyphs that 478 // match the width of the space glyph have the same width as the space glyph. 479 if (m_run.applyWordRounding() && roundedAdvanceWidth == roundedSpaceWidth && (fontData->pitch() == FixedPitch || glyph == fontData->spaceGlyph())) 480 advance.width = fontData->adjustedSpaceWidth(); 461 481 462 482 if (hasExtraSpacing) { … … 494 514 } 495 515 496 widthSinceLastCommit += advance.width; 516 // Apply rounding hacks if needed. 517 // We adjust the width of the last character of a "word" to ensure an integer width. 518 // Force characters that are used to determine word boundaries for the rounding hack 519 // to be integer width, so the following words will start on an integer boundary. 520 if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(ch)) 521 advance.width = ceilCGFloat(advance.width); 522 523 // Check to see if the next character is a "rounding hack character", if so, adjust the 524 // width so that the total run width will be on an integer boundary. 525 if ((m_run.applyWordRounding() && !lastGlyph && Font::isRoundingHackCharacter(nextCh)) || (m_run.applyRunRounding() && lastGlyph)) { 526 CGFloat totalWidth = widthSinceLastCommit + advance.width; 527 widthSinceLastCommit = ceilCGFloat(totalWidth); 528 CGFloat extraWidth = widthSinceLastCommit - totalWidth; 529 if (m_run.ltr()) 530 advance.width += extraWidth; 531 else { 532 if (m_lastRoundingGlyph) 533 m_adjustedAdvances[m_lastRoundingGlyph - 1].width += extraWidth; 534 else 535 m_finalRoundingWidth = extraWidth; 536 m_lastRoundingGlyph = m_adjustedAdvances.size() + 1; 537 } 538 m_totalWidth += widthSinceLastCommit; 539 widthSinceLastCommit = 0; 540 } else 541 widthSinceLastCommit += advance.width; 497 542 498 543 // FIXME: Combining marks should receive a text emphasis mark if they are combine with a space. -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h
r85507 r89733 73 73 float totalWidth() const { return m_totalWidth; } 74 74 75 float finalRoundingWidth() const { return m_finalRoundingWidth; } 76 75 77 float minGlyphBoundingBoxX() const { return m_minGlyphBoundingBoxX; } 76 78 float maxGlyphBoundingBoxX() const { return m_maxGlyphBoundingBoxX; } … … 184 186 unsigned m_glyphInCurrentRun; 185 187 unsigned m_characterInCurrentGlyph; 188 float m_finalRoundingWidth; 186 189 float m_expansion; 187 190 float m_expansionPerOpportunity; … … 195 198 float m_minGlyphBoundingBoxY; 196 199 float m_maxGlyphBoundingBoxY; 200 201 unsigned m_lastRoundingGlyph; 197 202 }; 198 203 -
trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
r88613 r89733 72 72 73 73 if (run.rtl()) { 74 initialAdvance = controller.totalWidth() - afterWidth;74 initialAdvance = controller.totalWidth() + controller.finalRoundingWidth() - afterWidth; 75 75 for (int i = 0, end = glyphBuffer.size() - 1; i < glyphBuffer.size() / 2; ++i, --end) 76 76 glyphBuffer.swap(i, end); -
trunk/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
r86401 r89733 114 114 return; 115 115 m_spaceGlyph = 0; 116 m_adjustedSpaceWidth = m_spaceWidth; 116 117 determinePitch(); 117 118 m_missingGlyphData.fontData = this; -
trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp
r89039 r89733 706 706 stringByAdoptingFileSystemRepresentation(systemBasename, string); 707 707 } else if (filenames.size() > 1) 708 return StringTruncator::rightTruncate(multipleFileUploadText(filenames.size()), width, font );709 710 return StringTruncator::centerTruncate(string, width, font );711 } 712 713 } 708 return StringTruncator::rightTruncate(multipleFileUploadText(filenames.size()), width, font, StringTruncator::EnableRoundingHacks); 709 710 return StringTruncator::centerTruncate(string, width, font, StringTruncator::EnableRoundingHacks); 711 } 712 713 } -
trunk/Source/WebCore/platform/mac/DragImageMac.mm
r88691 r89733 162 162 Font webCoreFont(FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]); 163 163 TextRun run(buffer.data(), length); 164 run.disableRoundingHacks(); 164 165 return webCoreFont.width(run); 165 166 } … … 202 203 Font webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], Antialiased); 203 204 TextRun run(buffer.data(), length); 205 run.disableRoundingHacks(); 204 206 205 207 CGFloat red; -
trunk/Source/WebCore/platform/win/DragImageWin.cpp
r89425 r89733 213 213 if (drawURLString) { 214 214 if (clipURLString) 215 urlString = StringTruncator::rightTruncate(urlString, imageSize.width() - (DragLabelBorderX * 2.0f), *urlFont );215 urlString = StringTruncator::rightTruncate(urlString, imageSize.width() - (DragLabelBorderX * 2.0f), *urlFont, StringTruncator::EnableRoundingHacks); 216 216 IntPoint textPos(DragLabelBorderX, imageSize.height() - (LabelBorderYOffset + urlFont->fontMetrics().descent())); 217 217 WebCoreDrawDoubledTextAtPoint(context, urlString, textPos, *urlFont, topColor, bottomColor); … … 219 219 220 220 if (clipLabelString) 221 label = StringTruncator::rightTruncate(label, imageSize.width() - (DragLabelBorderX * 2.0f), *labelFont );221 label = StringTruncator::rightTruncate(label, imageSize.width() - (DragLabelBorderX * 2.0f), *labelFont, StringTruncator::EnableRoundingHacks); 222 222 223 223 IntPoint textPos(DragLabelBorderX, DragLabelBorderY + labelFont->pixelSize()); -
trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp
r89425 r89733 107 107 FontCachePurgePreventer fontCachePurgePreventer; 108 108 109 return StringTruncator::width(text, font );109 return StringTruncator::width(text, font, StringTruncator::EnableRoundingHacks); 110 110 } 111 111 -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r89535 r89733 97 97 const Font& font = style()->font(); 98 98 TextRun textRun = constructTextRun(this, font, displayedFilename, style(), TextRun::AllowTrailingExpansion, RespectDirection | RespectDirectionOverride); 99 textRun.disableRoundingHacks(); 99 100 100 101 // Determine where the filename should be placed -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r88982 r89733 123 123 if (!text.isEmpty()) { 124 124 // FIXME: Why is this always LTR? Can't text direction affect the width? 125 float textWidth = itemFont.width(constructTextRun(this, itemFont, text, style(), TextRun::AllowTrailingExpansion)); 125 TextRun textRun = constructTextRun(this, itemFont, text, style(), TextRun::AllowTrailingExpansion); 126 textRun.disableRoundingHacks(); 127 float textWidth = itemFont.width(textRun); 126 128 width = max(width, textWidth); 127 129 } … … 396 398 unsigned length = itemText.length(); 397 399 const UChar* string = itemText.characters(); 398 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), itemStyle->unicodeBidi() == Override );400 TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), itemStyle->unicodeBidi() == Override, TextRun::NoRounding); 399 401 Font itemFont = style()->font(); 400 402 IntRect r = itemBoundingBoxRect(paintOffset, listIndex); -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r89505 r89733 531 531 const UChar ch = '0'; 532 532 const Font& font = style()->font(); 533 return font.width(constructTextRun(this, font, String(&ch, 1), style(), TextRun::AllowTrailingExpansion)); 533 TextRun textRun = constructTextRun(this, font, String(&ch, 1), style(), TextRun::AllowTrailingExpansion); 534 textRun.disableRoundingHacks(); 535 return font.width(textRun); 534 536 } 535 537 -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r89039 r89733 1106 1106 string = pathGetFileName(filenames[0]); 1107 1107 else 1108 return StringTruncator::rightTruncate(multipleFileUploadText(filenames.size()), width, font); 1109 1110 return StringTruncator::centerTruncate(string, width, font); 1111 } 1112 1108 return StringTruncator::rightTruncate(multipleFileUploadText(filenames.size()), width, font, StringTruncator::EnableRoundingHacks); 1109 1110 return StringTruncator::centerTruncate(string, width, font, StringTruncator::EnableRoundingHacks); 1111 } 1113 1112 1114 1113 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r89048 r89733 2063 2063 strToTruncate = [[NSFileManager defaultManager] displayNameAtPath:(filenames[0])]; 2064 2064 else 2065 return StringTruncator::rightTruncate(multipleFileUploadText(filenames.size()), width, font );2066 2067 return StringTruncator::centerTruncate(strToTruncate, width, font );2065 return StringTruncator::rightTruncate(multipleFileUploadText(filenames.size()), width, font, StringTruncator::EnableRoundingHacks); 2066 2067 return StringTruncator::centerTruncate(strToTruncate, width, font, StringTruncator::EnableRoundingHacks); 2068 2068 } 2069 2069 -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
r89710 r89733 431 431 run.setRenderingContext(SVGTextRunRenderingContext::create(text)); 432 432 433 run.disableRoundingHacks(); 434 433 435 // We handle letter & word spacing ourselves. 434 436 run.disableSpacing(); -
trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
r89732 r89733 88 88 run.setRenderingContext(SVGTextRunRenderingContext::create(text)); 89 89 90 run.disableRoundingHacks(); 91 90 92 // We handle letter & word spacing ourselves. 91 93 run.disableSpacing(); -
trunk/Source/WebKit/mac/ChangeLog
r89682 r89733 1 2011-06-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Add an option to enable legacy rounding hacks 6 https://bugs.webkit.org/show_bug.cgi?id=63363 7 8 * Misc/WebKitNSStringExtras.mm: 9 (-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]): 10 Disabled rounding hacks. 11 (-[NSString _web_widthWithFont:]): Ditto. 12 * WebView/WebView.mm: 13 (+[WebView _setAllowsRoundingHacks:]): Added this setter. 14 * WebView/WebViewPrivate.h: 15 1 16 2011-06-24 Dominic Cooney <dominicc@chromium.org> 2 17 -
trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm
r88260 r89733 95 95 Font webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], fontSmoothingIsAllowed ? AutoSmoothing : Antialiased); 96 96 TextRun run(buffer.data(), length); 97 run.disableRoundingHacks(); 97 98 98 99 CGFloat red; … … 142 143 Font webCoreFont(FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]); 143 144 TextRun run(buffer.data(), length); 145 run.disableRoundingHacks(); 144 146 return webCoreFont.width(run); 145 147 } -
trunk/Source/WebKit/mac/WebView/WebView.mm
r89669 r89733 1067 1067 } 1068 1068 1069 + (void)_setAllowsRoundingHacks:(BOOL)allowsRoundingHacks 1070 { 1071 TextRun::setAllowsRoundingHacks(allowsRoundingHacks); 1072 } 1073 1069 1074 + (BOOL)canCloseAllWebViews 1070 1075 { -
trunk/Source/WebKit/mac/WebView/WebViewPrivate.h
r87962 r89733 342 342 + (void)_setAlwaysUseATSU:(BOOL)f; 343 343 344 + (void)_setAllowsRoundingHacks:(BOOL)allowsRoundingHacks; 345 344 346 - (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL; 345 347 -
trunk/Source/WebKit/win/ChangeLog
r89669 r89733 1 2011-06-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Add an option to enable legacy rounding hacks 6 https://bugs.webkit.org/show_bug.cgi?id=63363 7 8 * WebKitGraphics.cpp: 9 (CenterTruncateStringToWidth): Enabled rounding hacks in the string truncator. 10 (RightTruncateStringToWidth): Ditto. 11 1 12 2011-06-24 Yuta Kitamura <yutak@chromium.org> 2 13 -
trunk/Source/WebKit/win/WebKitGraphics.cpp
r88260 r89733 151 151 FontCachePurgePreventer fontCachePurgePreventer; 152 152 153 String result = StringTruncator::centerTruncate(String(text, length), width, makeFont(description) );153 String result = StringTruncator::centerTruncate(String(text, length), width, makeFont(description), StringTruncator::EnableRoundingHacks); 154 154 memcpy(buffer, result.characters(), result.length() * sizeof(UChar)); 155 155 buffer[result.length()] = '\0'; … … 163 163 FontCachePurgePreventer fontCachePurgePreventer; 164 164 165 String result = StringTruncator::rightTruncate(String(text, length), width, makeFont(description) );165 String result = StringTruncator::rightTruncate(String(text, length), width, makeFont(description), StringTruncator::EnableRoundingHacks); 166 166 memcpy(buffer, result.characters(), result.length() * sizeof(UChar)); 167 167 buffer[result.length()] = '\0'; -
trunk/Tools/ChangeLog
r89702 r89733 1 2011-06-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Add an option to enable legacy rounding hacks 6 https://bugs.webkit.org/show_bug.cgi?id=63363 7 8 Added layoutTestController.allowRoundingHacks() and implemented it 9 on OS X. 10 11 * DumpRenderTree/LayoutTestController.cpp: 12 (allowRoundingHacksCallback): 13 (LayoutTestController::staticFunctions): 14 * DumpRenderTree/LayoutTestController.h: 15 * DumpRenderTree/chromium/LayoutTestController.cpp: 16 (LayoutTestController::allowRoundingHacks): 17 * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: 18 (LayoutTestController::allowRoundingHacks): 19 * DumpRenderTree/mac/DumpRenderTree.mm: 20 (resetWebViewToConsistentStateBeforeTesting): 21 * DumpRenderTree/mac/LayoutTestControllerMac.mm: 22 (LayoutTestController::allowRoundingHacks): 23 * DumpRenderTree/qt/LayoutTestControllerQt.cpp: 24 (LayoutTestController::allowRoundingHacks): 25 * DumpRenderTree/win/LayoutTestControllerWin.cpp: 26 (LayoutTestController::allowRoundingHacks): 27 * DumpRenderTree/wx/LayoutTestControllerWx.cpp: 28 (LayoutTestController::allowRoundingHacks): 29 1 30 2011-06-24 Adam Roben <aroben@apple.com> 2 31 -
trunk/Tools/DumpRenderTree/LayoutTestController.cpp
r89682 r89733 2122 2122 2123 2123 LayoutTestController::setSerializeHTTPLoads(serialize); 2124 return JSValueMakeUndefined(context); 2125 } 2126 2127 static JSValueRef allowRoundingHacksCallback(JSContextRef context, JSObjectRef thisObject, JSObjectRef, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 2128 { 2129 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 2130 2131 controller->allowRoundingHacks(); 2124 2132 return JSValueMakeUndefined(context); 2125 2133 } … … 2397 2405 { "setShouldPaintBrokenImage", setShouldPaintBrokenImageCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2398 2406 { "setTextDirection", setTextDirectionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2407 { "allowRoundingHacks", allowRoundingHacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2399 2408 { 0, 0, 0 } 2400 2409 }; -
trunk/Tools/DumpRenderTree/LayoutTestController.h
r89682 r89733 303 303 void evaluateInWebInspector(long callId, JSStringRef script); 304 304 void evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script); 305 void allowRoundingHacks(); 305 306 306 307 void setPOSIXLocale(JSStringRef locale); -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
r89682 r89733 1855 1855 setShouldDumpAsAudio(true); 1856 1856 } 1857 1858 void LayoutTestController::allowRoundingHacks() 1859 { 1860 } -
trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
r89682 r89733 978 978 // FIXME: Implement. 979 979 } 980 981 void LayoutTestController::allowRoundingHacks() 982 { 983 } -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r85083 r89733 1060 1060 [WebView _setUsesTestModeFocusRingColor:YES]; 1061 1061 [WebView _resetOriginAccessWhitelists]; 1062 [WebView _setAllowsRoundingHacks:NO]; 1062 1063 1063 1064 [[MockGeolocationProvider shared] stopTimer]; -
trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm
r89682 r89733 915 915 } 916 916 917 void LayoutTestController::allowRoundingHacks() 918 { 919 [WebView _setAllowsRoundingHacks:YES]; 920 } 921 917 922 @interface APITestDelegate : NSObject 918 923 { -
trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
r89682 r89733 950 950 } 951 951 952 void LayoutTestController::allowRoundingHacks() 953 { 954 } 955 952 956 const unsigned LayoutTestController::maxViewWidth = 800; 953 957 const unsigned LayoutTestController::maxViewHeight = 600; -
trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp
r89682 r89733 1527 1527 // FIXME: Implement. 1528 1528 } 1529 1530 void LayoutTestController::allowRoundingHacks() 1531 { 1532 } -
trunk/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
r89682 r89733 636 636 // FIXME: Implement. 637 637 } 638 639 void LayoutTestController::allowRoundingHacks() 640 { 641 }
Note: See TracChangeset
for help on using the changeset viewer.