Changeset 61548 in webkit
- Timestamp:
- Jun 21, 2010, 9:54:52 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/ChangeLog ¶
r61532 r61548 1 2010-06-21 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Added tests for the 'hyphens' and 'hyphenate-character' properties 6 https://bugs.webkit.org/show_bug.cgi?id=10228 7 8 * fast/text/hyphenate-character.html: Added. 9 * fast/text/hyphens.html: Added. 10 * platform/gtk/Skipped: 11 * platform/mac/fast/text/hyphenate-character-expected.checksum: Added. 12 * platform/mac/fast/text/hyphenate-character-expected.png: Added. 13 * platform/mac/fast/text/hyphenate-character-expected.txt: Added. 14 * platform/mac/fast/text/hyphens-expected.checksum: Added. 15 * platform/mac/fast/text/hyphens-expected.png: Added. 16 * platform/mac/fast/text/hyphens-expected.txt: Added. 17 * platform/qt/Skipped: 18 * platform/win/Skipped: 19 1 20 2010-06-21 Dumitru Daniliuc <dumi@chromium.org> 2 21 -
TabularUnified trunk/LayoutTests/platform/gtk/Skipped ¶
r61440 r61548 3125 3125 fast/text/firstline/002.html 3126 3126 fast/text/firstline/003.html 3127 # Hyphenation is not implemented yet. 3128 fast/text/hyphenate-character.html 3129 fast/text/hyphens.html 3130 3127 3131 fast/text/international/001.html 3128 3132 fast/text/international/002.html -
TabularUnified trunk/LayoutTests/platform/qt/Skipped ¶
r61505 r61548 103 103 fast/loader/subframe-navigate-during-main-frame-load.html 104 104 105 # Hyphenation is not implemented yet. 106 fast/text/hyphenate-character.html 107 fast/text/hyphens.html 105 108 106 109 # =========================================================================== # -
TabularUnified trunk/LayoutTests/platform/win/Skipped ¶
r61376 r61548 899 899 # LayoutTestController::pageProperty is not implemented for WIN yet. 900 900 printing/page-rule-selection.html 901 902 # Hyphenation is not implemented yet. 903 fast/text/hyphenate-character.html 904 fast/text/hyphens.html -
TabularUnified trunk/WebCore/Android.mk ¶
r61511 r61548 528 528 platform/text/Base64.cpp \ 529 529 platform/text/BidiContext.cpp \ 530 platform/text/Hyphenation.cpp \ 530 531 platform/text/RegularExpression.cpp \ 531 532 platform/text/SegmentedString.cpp \ -
TabularUnified trunk/WebCore/CMakeLists.txt ¶
r61531 r61548 1247 1247 platform/text/Base64.cpp 1248 1248 platform/text/BidiContext.cpp 1249 platform/text/Hyphenation.cpp 1249 1250 platform/text/RegularExpression.cpp 1250 1251 platform/text/SegmentedString.cpp -
TabularUnified trunk/WebCore/ChangeLog ¶
r61546 r61548 1 2010-06-21 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 CSS3: Implement the 'hyphens' and 'hyphenate-character' properties 6 https://bugs.webkit.org/show_bug.cgi?id=10228 7 8 Tests: fast/text/hyphenate-character.html 9 fast/text/hyphens.html 10 11 Added -webkit-hyphens and -webkit-hyphenate-character as specified in 12 <http://www.w3.org/TR/2010/WD-css3-gcpm-20100608/#hyphenation>. 13 14 * Android.mk: Added Hyphenation.cpp. 15 * CMakeLists.txt: Ditto. 16 * GNUmakefile.am: Added Hyphenation.{cpp,h}. 17 * WebCore.base.exp: Exported wkGetHyphenationLocationBeforeIndex(). 18 * WebCore.gypi: Added Hyphenation.{cpp,h}. 19 * WebCore.pro: Added Hyphenation.{cpp,h}. 20 * WebCore.vcproj/WebCore.vcproj: Added Hyphenation.{cpp,h}. 21 * WebCore.xcodeproj/project.pbxproj: Added Hyphenation.{cpp,h}. 22 * css/CSSComputedStyleDeclaration.cpp: 23 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added the -webkit-hyphenate-character 24 and -webkit-hyphens cases. 25 * css/CSSParser.cpp: 26 (WebCore::CSSParser::parseValue): Validate values for the new properties. 27 * css/CSSPrimitiveValueMappings.h: 28 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added. Maps from a Hyphens value to an identifier. 29 (WebCore::CSSPrimitiveValue::operator Hyphens): Added. Maps from an identifier to a Hyphens value. 30 * css/CSSPropertyNames.in: Added -webkit-hyphenate-character and -webkit-hyphens. 31 * css/CSSStyleSelector.cpp: 32 (WebCore::CSSStyleSelector::applyProperty): Apply the new properties to the RenderStyle. 33 * css/CSSValueKeywords.in: 34 * platform/mac/WebCoreSystemInterface.h: Added wkGetHyphenationLocationBeforeIndex. 35 * platform/mac/WebCoreSystemInterface.mm: Ditto. 36 * platform/text/CharacterNames.h: Added the hyphen character. 37 * platform/text/Hyphenation.cpp: Added. 38 (WebCore::lastHyphenLocation): Added this default implementation for platforms that do not implement 39 hyphenation yet. It calls notImplemented() and returns 0. 40 * platform/text/Hyphenation.h: Added. 41 * platform/text/cf/HyphenationCF.cpp: Added. 42 (WebCore::lastHyphenLocation): Returns the last hyphenation location occurring in the given string before 43 the given index. Uses the current search locale (which is based on the top language preference of the user) 44 for hyphenation. 45 * platform/text/mac/HyphenationMac.mm: Added. 46 (WebCore::lastHyphenLocation): Returns the last hyphenation location occurring in the given string before 47 the given index. Returns 0 if the current search locale is not "en", because the platform only knows how to 48 hyphenate English. 49 * rendering/BidiRun.h: 50 (WebCore::BidiRun::BidiRun): Added a boolean member, m_hasHyphen, and initialized it to false in the constructor. 51 * rendering/InlineBox.h: 52 (WebCore::InlineBox::InlineBox): Renamed m_hasEllipsisBox to m_hasEllipsisBoxOrHyphen, because this bit is now 53 shared by two subclass: RootInlineBox uses it for hasEllipsisBox(), while InlineTextBox uses it for hasHyphen(). 54 * rendering/InlineTextBox.cpp: 55 (WebCore::adjustCharactersAndLengthForHyphen): Added this helper function to get the hyphen string from the style 56 and return a UChar* and length for the concatenation of the given text with the hyphen string. 57 (WebCore::InlineTextBox::selectionRect): If the selected range touches the end and the box has a hyphen, 58 compute the width of the text with the hyphen string concatenated to it. 59 (WebCore::InlineTextBox::paint): If the box has a hyphen, draw the text with the hyphen string concatenated to it. 60 (WebCore::InlineTextBox::paintSelection): Similarly concatenate the hyphen string. 61 * rendering/InlineTextBox.h: 62 (WebCore::InlineTextBox::hasHyphen): Added this accessor. 63 (WebCore::InlineTextBox::setHasHyphen): Ditto. 64 * rendering/RenderBlock.h: 65 * rendering/RenderBlockLineLayout.cpp: 66 (WebCore::RenderBlock::constructLine): Copy the m_hasHyphen flag from the run to its text box. 67 (WebCore::RenderBlock::computeHorizontalPositionsForLine): Add the width of the hyphen string when computing the 68 width of a box that has a hyphen. 69 (WebCore::RenderBlock::layoutInlineChildren): If the line was hyphenated, set the m_hasHyphen flag on the 70 logically last run. 71 (WebCore::tryHyphenating): Added this helper function which checks if a piece of text that does not fit on the 72 line could be hyphenated such that the part before the hyphen, including the hyphen, would fit. Given the amount 73 of space remaining on the line, it finds the longest prefix that can fit in the remaining space (which leaving room for 74 the hyphen), and then checks for a hyphenation location within that prefix. 75 (WebCore::RenderBlock::findNextLineBreak): In the 'hyphens: none' case, prevent line breaks at soft hyphens. 76 In the 'hyphens: auto' case, try hyphenating when a word will not fit in the remaining space on the line. 77 * rendering/RootInlineBox.cpp: 78 (WebCore::RootInlineBox::detachEllipsisBox): Changed to use hasEllipsisBox() and setHasEllipsisBox(). 79 (WebCore::RootInlineBox::clearTruncation): Ditto. 80 (WebCore::RootInlineBox::placeEllipsis): Ditto. 81 (WebCore::RootInlineBox::paintEllipsisBox): Ditto. 82 (WebCore::RootInlineBox::nodeAtPoint): Ditto. 83 (WebCore::RootInlineBox::ellipsisBox): Ditto. 84 * rendering/RootInlineBox.h: 85 (WebCore::RootInlineBox::hasEllipsisBox): Added this accessor. 86 (WebCore::RootInlineBox::setHasEllipsisBox): Ditto. 87 * rendering/style/RenderStyle.cpp: 88 (WebCore::RenderStyle::diff): Return a layout hint if the hyphens setting or hyphenate-character differs. 89 (WebCore::RenderStyle::hyphenString): Added. For hyphenate-character: auto, returns the hyphen character. 90 * rendering/style/RenderStyle.h: 91 (WebCore::InheritedFlags::hyphens): Added this accessor. 92 (WebCore::InheritedFlags::hyphenateCharacter): Ditto. 93 (WebCore::InheritedFlags::setHyphens): Ditto. 94 (WebCore::InheritedFlags::setHyphenateCharacter): Ditto. 95 (WebCore::InheritedFlags::initialHyphens): Added. Returns HyphensManual. 96 (WebCore::InheritedFlags::initialHyphenateCharacter): Added. Returns the null string, corresponding to 97 a value of 'auto'. 98 * rendering/style/RenderStyleConstants.h: 99 Added a Hyphens enum. 100 * rendering/style/StyleRareInheritedData.cpp: 101 (WebCore::StyleRareInheritedData::StyleRareInheritedData): Initialize and copy the new members. 102 (WebCore::StyleRareInheritedData::operator==): Compare the new members. 103 * rendering/style/StyleRareInheritedData.h: Added two new members: hyphens and hyphenateCharacter. 104 1 105 2010-06-03 Dimitri Glazkov <dglazkov@chromium.org> 2 106 -
TabularUnified trunk/WebCore/GNUmakefile.am ¶
r61545 r61548 1808 1808 WebCore/platform/text/BidiResolver.h \ 1809 1809 WebCore/platform/text/CharacterNames.h \ 1810 WebCore/platform/text/Hyphenation.cpp \ 1811 WebCore/platform/text/Hyphenation.h \ 1810 1812 WebCore/platform/text/ParserUtilities.h \ 1811 1813 WebCore/platform/text/PlatformString.h \ -
TabularUnified trunk/WebCore/WebCore.base.exp ¶
r61438 r61548 1022 1022 _wkGetGlyphTransformedAdvances 1023 1023 _wkGetGlyphsForCharacters 1024 _wkGetHyphenationLocationBeforeIndex 1024 1025 _wkGetMIMETypeForExtension 1025 1026 _wkGetNSURLResponseCalculatedExpiration -
TabularUnified trunk/WebCore/WebCore.gypi ¶
r61531 r61548 2763 2763 'platform/text/BidiResolver.h', 2764 2764 'platform/text/CharacterNames.h', 2765 'platform/text/Hyphenation.cpp', 2766 'platform/text/Hyphenation.h', 2765 2767 'platform/text/ParserUtilities.h', 2766 2768 'platform/text/PlatformString.h', -
TabularUnified trunk/WebCore/WebCore.pro ¶
r61511 r61548 826 826 platform/text/Base64.cpp \ 827 827 platform/text/BidiContext.cpp \ 828 platform/text/Hyphenation.cpp \ 828 829 platform/ContentType.cpp \ 829 830 platform/ContextMenu.cpp \ … … 1673 1674 platform/text/Base64.h \ 1674 1675 platform/text/BidiContext.h \ 1676 platform/text/Hyphenation.h \ 1675 1677 platform/text/qt/TextCodecQt.h \ 1676 1678 platform/text/RegularExpression.h \ -
TabularUnified trunk/WebCore/WebCore.vcproj/WebCore.vcproj ¶
r61531 r61548 26241 26241 </File> 26242 26242 <File 26243 RelativePath="..\platform\text\Hyphentation.cpp" 26244 > 26245 </File> 26246 <File 26247 RelativePath="..\platform\text\Hyphenation.h" 26248 > 26249 </File> 26250 <File 26243 26251 RelativePath="..\platform\text\ParserUtilities.h" 26244 26252 > -
TabularUnified trunk/WebCore/WebCore.xcodeproj/project.pbxproj ¶
r61531 r61548 737 737 33C0CCD4112C5E6200CE057D /* SecureTextInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */; }; 738 738 33C0CCD5112C5E6200CE057D /* SecureTextInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C0CCD3112C5E6200CE057D /* SecureTextInput.h */; }; 739 371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */; }; 739 740 371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 740 741 371F4F410D25B9AF00ECE0D5 /* FontData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */; }; … … 747 748 37202199106213C600F25C4B /* FontSmoothingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 37202198106213C600F25C4B /* FontSmoothingMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 748 749 3744570F0DB05FA500AE0992 /* SVGGlyphMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 3744570E0DB05FA500AE0992 /* SVGGlyphMap.h */; }; 750 375CD232119D43C800A2A859 /* Hyphenation.h in Headers */ = {isa = PBXBuildFile; fileRef = 375CD231119D43C800A2A859 /* Hyphenation.h */; }; 751 375CD23B119D44EA00A2A859 /* HyphenationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 375CD239119D44EA00A2A859 /* HyphenationMac.mm */; }; 749 752 3774ABA50FA21EB400AD7DE9 /* OverlapTestRequestClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 750 753 377C4CDF1014E9F600B9AE42 /* PlaceholderDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 377C4CDD1014E9F600B9AE42 /* PlaceholderDocument.h */; }; … … 6316 6319 33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecureTextInput.cpp; sourceTree = "<group>"; }; 6317 6320 33C0CCD3112C5E6200CE057D /* SecureTextInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecureTextInput.h; sourceTree = "<group>"; }; 6321 371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HyphenationCF.cpp; sourceTree = "<group>"; }; 6318 6322 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontData.h; sourceTree = "<group>"; }; 6319 6323 371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontData.cpp; sourceTree = "<group>"; }; … … 6326 6330 37202198106213C600F25C4B /* FontSmoothingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSmoothingMode.h; sourceTree = "<group>"; }; 6327 6331 3744570E0DB05FA500AE0992 /* SVGGlyphMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGGlyphMap.h; sourceTree = "<group>"; }; 6332 375CD231119D43C800A2A859 /* Hyphenation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Hyphenation.h; sourceTree = "<group>"; }; 6333 375CD239119D44EA00A2A859 /* HyphenationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HyphenationMac.mm; sourceTree = "<group>"; }; 6328 6334 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlapTestRequestClient.h; sourceTree = "<group>"; }; 6329 6335 377C4CDD1014E9F600B9AE42 /* PlaceholderDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaceholderDocument.h; sourceTree = "<group>"; }; … … 10778 10784 1C81B94D0E9732D900266E07 /* inspector */, 10779 10785 BCB16BFB0979C38700467741 /* loader */, 10780 FABE72EC1059C1EB00D999DD /* mathml */,10781 10786 333F703D0FB49C16008E12A6 /* notifications */, 10782 10787 65BF02180974806300C43196 /* page */, … … 15235 15240 isa = PBXGroup; 15236 15241 children = ( 15242 371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */, 15237 15243 B2B2645A0D00A77E000ACC1D /* StringCF.cpp */, 15238 15244 B2B2645B0D00A77E000ACC1D /* StringImplCF.cpp */, … … 15256 15262 B2C3D9F40D006C1D00EF6F26 /* BidiResolver.h */, 15257 15263 B2C3D9F50D006C1D00EF6F26 /* CharacterNames.h */, 15264 375CD231119D43C800A2A859 /* Hyphenation.h */, 15258 15265 BC76AC110DD7AD5C00415F34 /* ParserUtilities.h */, 15259 15266 B2C3D9FB0D006C1D00EF6F26 /* PlatformString.h */, … … 15303 15310 B2AFFC850D00A5DF0030074D /* character-sets.txt */, 15304 15311 B2C3D9FA0D006C1D00EF6F26 /* CharsetData.h */, 15312 375CD239119D44EA00A2A859 /* HyphenationMac.mm */, 15305 15313 B2AFFC860D00A5DF0030074D /* mac-encodings.txt */, 15306 15314 B2AFFC870D00A5DF0030074D /* make-charset-table.pl */, … … 15716 15724 isa = PBXGroup; 15717 15725 children = ( 15726 FABE72EC1059C1EB00D999DD /* mathml */, 15718 15727 1A8F6BB00DB55CDC001DB794 /* appcache */, 15719 15728 512DD8E80D91E691000F89EE /* archive */, … … 16861 16870 FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */, 16862 16871 ); 16863 path = mathml; 16872 name = mathml; 16873 path = ../mathml; 16864 16874 sourceTree = "<group>"; 16865 16875 }; … … 18105 18115 514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */, 18106 18116 514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */, 18117 375CD232119D43C800A2A859 /* Hyphenation.h in Headers */, 18107 18118 B275356E0B053814002CE64F /* Icon.h in Headers */, 18108 18119 5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */, … … 20437 20448 0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */, 20438 20449 514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */, 20450 371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */, 20451 375CD23B119D44EA00A2A859 /* HyphenationMac.mm in Sources */, 20439 20452 5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */, 20440 20453 445C8DB710015FC90031531A /* IconDatabaseNone.cpp in Sources */, -
TabularUnified trunk/WebCore/css/CSSComputedStyleDeclaration.cpp ¶
r60885 r61548 1 1 /* 2 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 5 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> … … 906 906 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 907 907 return CSSPrimitiveValue::create(style->highlight(), CSSPrimitiveValue::CSS_STRING); 908 case CSSPropertyWebkitHyphens: 909 return CSSPrimitiveValue::create(style->hyphens()); 910 case CSSPropertyWebkitHyphenateCharacter: 911 if (style->hyphenateCharacter().isNull()) 912 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 913 return CSSPrimitiveValue::create(style->hyphenateCharacter(), CSSPrimitiveValue::CSS_STRING); 908 914 case CSSPropertyWebkitBorderFit: 909 915 if (style->borderFit() == BorderFitBorder) -
TabularUnified trunk/WebCore/css/CSSParser.cpp ¶
r61383 r61548 2 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 3 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 6 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> … … 1555 1555 case CSSPropertyWebkitHighlight: 1556 1556 if (id == CSSValueNone || value->unit == CSSPrimitiveValue::CSS_STRING) 1557 validPrimitive = true; 1558 break; 1559 1560 case CSSPropertyWebkitHyphens: 1561 if (id == CSSValueNone || id == CSSValueManual || id == CSSValueAuto) 1562 validPrimitive = true; 1563 break; 1564 1565 case CSSPropertyWebkitHyphenateCharacter: 1566 if (id == CSSValueAuto || value->unit == CSSPrimitiveValue::CSS_STRING) 1557 1567 validPrimitive = true; 1558 1568 break; -
TabularUnified trunk/WebCore/css/CSSPrimitiveValueMappings.h ¶
r60885 r61548 1 1 /* 2 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.3 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) 5 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> … … 2158 2158 } 2159 2159 2160 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Hyphens hyphens) 2161 : m_type(CSS_IDENT) 2162 , m_hasCachedCSSText(false) 2163 { 2164 switch (hyphens) { 2165 case HyphensNone: 2166 m_value.ident = CSSValueNone; 2167 break; 2168 case HyphensManual: 2169 m_value.ident = CSSValueManual; 2170 break; 2171 case HyphensAuto: 2172 m_value.ident = CSSValueAuto; 2173 break; 2174 } 2175 } 2176 2177 template<> inline CSSPrimitiveValue::operator Hyphens() const 2178 { 2179 switch (m_value.ident) { 2180 case CSSValueNone: 2181 return HyphensNone; 2182 case CSSValueManual: 2183 return HyphensManual; 2184 case CSSValueAuto: 2185 return HyphensAuto; 2186 default: 2187 ASSERT_NOT_REACHED(); 2188 return HyphensAuto; 2189 } 2190 } 2191 2160 2192 #if ENABLE(SVG) 2161 2193 -
TabularUnified trunk/WebCore/css/CSSPropertyNames.in ¶
r59968 r61548 210 210 -webkit-font-smoothing 211 211 -webkit-highlight 212 -webkit-hyphenate-character 213 -webkit-hyphens 212 214 -webkit-line-break 213 215 -webkit-line-clamp -
TabularUnified trunk/WebCore/css/CSSStyleSelector.cpp ¶
r61383 r61548 5179 5179 else 5180 5180 m_style->setHighlight(primitiveValue->getStringValue()); 5181 return; 5182 } 5183 case CSSPropertyWebkitHyphens: { 5184 HANDLE_INHERIT_AND_INITIAL(hyphens, Hyphens); 5185 m_style->setHyphens(*primitiveValue); 5186 return; 5187 } 5188 case CSSPropertyWebkitHyphenateCharacter: { 5189 HANDLE_INHERIT_AND_INITIAL(hyphenateCharacter, HyphenateCharacter); 5190 if (primitiveValue->getIdent() == CSSValueAuto) 5191 m_style->setHyphenateCharacter(nullAtom); 5192 else 5193 m_style->setHyphenateCharacter(primitiveValue->getStringValue()); 5181 5194 return; 5182 5195 } -
TabularUnified trunk/WebCore/css/CSSValueKeywords.in ¶
r60822 r61548 731 731 minimized 732 732 windowed 733 734 # -webkit-hyphens 735 # none 736 manual 737 # auto -
TabularUnified trunk/WebCore/platform/mac/WebCoreSystemInterface.h ¶
r61453 r61548 1 1 /* 2 * Copyright 2006, 2007, 2008, 20 10 Apple Inc. All rights reserved.2 * Copyright 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 171 171 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 172 172 extern NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *); 173 extern void* wkGetHyphenationLocationBeforeIndex; 173 174 #else 174 175 extern void* wkNoteOpenPanelFiles; 176 extern CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index); 175 177 #endif 176 178 -
TabularUnified trunk/WebCore/platform/mac/WebCoreSystemInterface.mm ¶
r60974 r61548 1 1 /* 2 * Copyright 2006, 2007, 2008, 20 10 Apple Computer, Inc. All rights reserved.2 * Copyright 2006, 2007, 2008, 2009, 2010 Apple Computer, Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 113 113 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 114 114 NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *); 115 void* wkGetHyphenationLocationBeforeIndex; 115 116 #else 116 117 void* wkNoteOpenPanelFiles; 118 CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index); 117 119 #endif -
TabularUnified trunk/WebCore/platform/text/CharacterNames.h ¶
r60063 r61548 43 43 const UChar hebrewPunctuationGershayim = 0x05F4; 44 44 const UChar horizontalEllipsis = 0x2026; 45 const UChar hyphen = 0x2010; 45 46 const UChar hyphenMinus = 0x002D; 46 47 const UChar ideographicComma = 0x3001; -
TabularUnified trunk/WebCore/rendering/BidiRun.h ¶
r54665 r61548 39 39 , m_object(object) 40 40 , m_box(0) 41 , m_hasHyphen(false) 41 42 { 42 43 } … … 59 60 RenderObject* m_object; 60 61 InlineBox* m_box; 62 bool m_hasHyphen; 61 63 }; 62 64 -
TabularUnified trunk/WebCore/rendering/InlineBox.h ¶
r61393 r61548 54 54 , m_endsWithBreak(false) 55 55 , m_hasSelectedChildren(false) 56 , m_hasEllipsisBox (false)56 , m_hasEllipsisBoxOrHyphen(false) 57 57 , m_dirOverride(false) 58 58 , m_isText(false) … … 87 87 , m_endsWithBreak(false) 88 88 , m_hasSelectedChildren(false) 89 , m_hasEllipsisBox (false)89 , m_hasEllipsisBoxOrHyphen(false) 90 90 , m_dirOverride(false) 91 91 , m_isText(false) … … 285 285 bool m_endsWithBreak : 1; // Whether the line ends with a <br>. 286 286 bool m_hasSelectedChildren : 1; // Whether we have any children selected (this bit will also be set if the <br> that terminates our line is selected). 287 bool m_hasEllipsisBox : 1;287 bool m_hasEllipsisBoxOrHyphen : 1; 288 288 289 289 // for InlineTextBox -
TabularUnified trunk/WebCore/rendering/InlineTextBox.cpp ¶
r60753 r61548 2 2 * (C) 1999 Lars Knoll (knoll@kde.org) 3 3 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 104 104 } 105 105 106 typedef Vector<UChar, 256> BufferForAppendingHyphen; 107 108 static void adjustCharactersAndLengthForHyphen(BufferForAppendingHyphen& charactersWithHyphen, RenderStyle* style, const UChar*& characters, int& length) 109 { 110 const AtomicString& hyphenString = style->hyphenString(); 111 charactersWithHyphen.reserveCapacity(length + hyphenString.length()); 112 charactersWithHyphen.append(characters, length); 113 charactersWithHyphen.append(hyphenString.characters(), hyphenString.length()); 114 characters = charactersWithHyphen.data(); 115 length += hyphenString.length(); 116 } 117 106 118 IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos) 107 119 { … … 115 127 int selTop = selectionTop(); 116 128 int selHeight = selectionHeight(); 117 const Font& f = textObj->style(m_firstLine)->font(); 118 119 IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(textObj->text()->characters() + m_start, m_len, textObj->allowTabs(), textPos(), m_toAdd, direction() == RTL, m_dirOverride), 129 RenderStyle* styleToUse = textObj->style(m_firstLine); 130 const Font& f = styleToUse->font(); 131 132 const UChar* characters = textObj->text()->characters() + m_start; 133 int len = m_len; 134 BufferForAppendingHyphen charactersWithHyphen; 135 if (ePos == len && hasHyphen()) { 136 adjustCharactersAndLengthForHyphen(charactersWithHyphen, styleToUse, characters, len); 137 ePos = len; 138 } 139 140 IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_toAdd, direction() == RTL, m_dirOverride), 120 141 IntPoint(tx + m_x, ty + selTop), selHeight, sPos, ePos)); 121 142 if (r.x() > tx + m_x + m_width) … … 465 486 } 466 487 488 const UChar* characters = textRenderer()->text()->characters() + m_start; 489 int length = m_len; 490 BufferForAppendingHyphen charactersWithHyphen; 491 if (hasHyphen()) 492 adjustCharactersAndLengthForHyphen(charactersWithHyphen, styleToUse, characters, length); 493 467 494 int baseline = renderer()->style(m_firstLine)->font().ascent(); 468 495 IntPoint textOrigin(m_x + tx, m_y + ty + baseline); 469 TextRun textRun( textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, direction() == RTL, m_dirOverride || styleToUse->visuallyOrdered());496 TextRun textRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd, direction() == RTL, m_dirOverride || styleToUse->visuallyOrdered()); 470 497 471 498 int sPos = 0; … … 474 501 selectionStartEnd(sPos, ePos); 475 502 476 int length = m_len;477 503 if (m_truncation != cNoTruncation) { 478 504 sPos = min<int>(sPos, m_truncation); … … 589 615 // draw its own highlight. 590 616 int length = m_truncation != cNoTruncation ? m_truncation : m_len; 617 const UChar* characters = textRenderer()->text()->characters() + m_start; 618 619 BufferForAppendingHyphen charactersWithHyphen; 620 if (ePos == length && hasHyphen()) { 621 adjustCharactersAndLengthForHyphen(charactersWithHyphen, style, characters, length); 622 ePos = length; 623 } 624 591 625 context->clip(IntRect(m_x + tx, y + ty, m_width, h)); 592 context->drawHighlightForText(font, TextRun( textRenderer()->text()->characters() + m_start, length, textRenderer()->allowTabs(), textPos(), m_toAdd,626 context->drawHighlightForText(font, TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd, 593 627 direction() == RTL, m_dirOverride || style->visuallyOrdered()), 594 628 IntPoint(m_x + tx, y + ty), h, c, style->colorSpace(), sPos, ePos); -
TabularUnified trunk/WebCore/rendering/InlineTextBox.h ¶
r61393 r61548 65 65 66 66 unsigned short truncation() { return m_truncation; } 67 68 bool hasHyphen() const { return m_hasEllipsisBoxOrHyphen; } 69 void setHasHyphen(bool hasHyphen) { m_hasEllipsisBoxOrHyphen = hasHyphen; } 67 70 68 71 private: -
TabularUnified trunk/WebCore/rendering/RenderBlock.h ¶
r61393 r61548 308 308 int skipLeadingWhitespace(InlineBidiResolver&, bool firstLine, bool isLineEmpty, bool previousLineBrokeCleanly); 309 309 void fitBelowFloats(int widthToFit, bool firstLine, int& availableWidth); 310 InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly, EClear* clear= 0);310 InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly, bool& hyphenated, EClear* = 0); 311 311 RootInlineBox* constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, RenderObject* endObject); 312 312 InlineFlowBox* createLineBoxes(RenderObject*, bool firstLine); -
TabularUnified trunk/WebCore/rendering/RenderBlockLineLayout.cpp ¶
r61393 r61548 25 25 #include "BidiResolver.h" 26 26 #include "CharacterNames.h" 27 #include "Hyphenation.h" 27 28 #include "InlineIterator.h" 28 29 #include "InlineTextBox.h" … … 296 297 text->setLen(r->m_stop - r->m_start); 297 298 text->m_dirOverride = r->dirOverride(visuallyOrdered); 299 if (r->m_hasHyphen) 300 text->setHasHyphen(true); 298 301 } 299 302 } … … 350 353 GlyphOverflow glyphOverflow; 351 354 r->m_box->setWidth(rt->width(r->m_start, r->m_stop - r->m_start, totWidth, firstLine, &fallbackFonts, &glyphOverflow)); 355 int hyphenWidth = 0; 356 if (static_cast<InlineTextBox*>(r->m_box)->hasHyphen()) { 357 const AtomicString& hyphenString = rt->style()->hyphenString(); 358 hyphenWidth = rt->style(firstLine)->font().width(TextRun(hyphenString.characters(), hyphenString.length())); 359 } 360 r->m_box->setWidth(rt->width(r->m_start, r->m_stop - r->m_start, totWidth, firstLine, &fallbackFonts, &glyphOverflow) + hyphenWidth); 352 361 if (!fallbackFonts.isEmpty()) { 353 362 ASSERT(r->m_box->isText()); … … 669 678 670 679 EClear clear = CNONE; 671 end = findNextLineBreak(resolver, firstLine, isLineEmpty, previousLineBrokeCleanly, &clear); 680 bool hyphenated; 681 end = findNextLineBreak(resolver, firstLine, isLineEmpty, previousLineBrokeCleanly, hyphenated, &clear); 672 682 if (resolver.position().atEnd()) { 673 683 resolver.deleteRuns(); … … 735 745 RootInlineBox* lineBox = 0; 736 746 if (resolver.runCount()) { 747 if (hyphenated) 748 resolver.logicallyLastRun()->m_hasHyphen = true; 737 749 lineBox = constructLine(resolver.runCount(), resolver.firstRun(), resolver.lastRun(), firstLine, !end.obj, end.obj && !end.pos ? end.obj : 0); 738 750 if (lineBox) { … … 1318 1330 } 1319 1331 1332 static void tryHyphenating(RenderText* text, const Font& font, int lastSpace, int pos, int xPos, int availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator& lineBreak, int nextBreakable, bool& hyphenated) 1333 { 1334 const AtomicString& hyphenString = text->style()->hyphenString(); 1335 int hyphenWidth = font.width(TextRun(hyphenString.characters(), hyphenString.length())); 1336 1337 unsigned prefixLength = font.offsetForPosition(TextRun(text->characters() + lastSpace, pos - lastSpace, !collapseWhiteSpace, xPos + lastSpaceWordSpacing), availableWidth - xPos - hyphenWidth - lastSpaceWordSpacing, false); 1338 if (!prefixLength) 1339 return; 1340 1341 prefixLength = 1 + lastHyphenLocation(text->characters() + lastSpace + 1, pos - lastSpace - 1, prefixLength - 1); 1342 if (prefixLength <= 1) 1343 return; 1344 1345 #if !ASSERT_DISABLED 1346 int prefixWidth = hyphenWidth + textWidth(text, lastSpace, prefixLength, font, xPos, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing; 1347 ASSERT(xPos + prefixWidth <= availableWidth); 1348 #endif 1349 1350 lineBreak.obj = text; 1351 lineBreak.pos = lastSpace + prefixLength; 1352 lineBreak.nextBreakablePosition = nextBreakable; 1353 hyphenated = true; 1354 } 1355 1320 1356 InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly, 1321 EClear* clear)1357 bool& hyphenated, EClear* clear) 1322 1358 { 1323 1359 ASSERT(resolver.position().block == this); … … 1356 1392 bool prevLineBrokeCleanly = previousLineBrokeCleanly; 1357 1393 previousLineBrokeCleanly = false; 1394 1395 hyphenated = false; 1358 1396 1359 1397 bool autoWrapWasEverTrueOnLine = false; … … 1530 1568 const UChar* str = t->characters(); 1531 1569 1532 const Font& f = t->style(firstLine)->font(); 1570 RenderStyle* style = t->style(firstLine); 1571 const Font& f = style->font(); 1533 1572 bool isFixedPitch = f.isFixedPitch(); 1573 bool canHyphenate = style->hyphens() == HyphensAuto; 1534 1574 1535 1575 int lastSpace = pos; … … 1601 1641 lastSpaceWordSpacing = 0; 1602 1642 lastSpace = pos; // Cheesy hack to prevent adding in widths of the run twice. 1643 if (style->hyphens() == HyphensNone) { 1644 // Prevent a line break at the soft hyphen by ensuring that betweenWords is false 1645 // in the next iteration. 1646 atStart = true; 1647 } 1603 1648 continue; 1604 1649 } … … 1670 1715 } 1671 1716 } 1717 if (canHyphenate && w + tmpW > width) { 1718 tryHyphenating(t, f, lastSpace, pos, w + tmpW - additionalTmpW, width, isFixedPitch, collapseWhiteSpace, lastSpaceWordSpacing, lBreak, nextBreakable, hyphenated); 1719 if (hyphenated) 1720 goto end; 1721 } 1672 1722 if (lineWasTooWide || w + tmpW > width) { 1673 1723 if (lBreak.obj && shouldPreserveNewline(lBreak.obj) && lBreak.obj->isText() && toRenderText(lBreak.obj)->textLength() && !toRenderText(lBreak.obj)->isWordBreak() && toRenderText(lBreak.obj)->characters()[lBreak.pos] == '\n') { … … 1776 1826 1777 1827 // IMPORTANT: pos is > length here! 1778 i f (!ignoringSpaces)1779 tmpW += textWidth(t, lastSpace, pos - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing;1828 int additionalTmpW = ignoringSpaces ? 0 : textWidth(t, lastSpace, pos - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing; 1829 tmpW += additionalTmpW; 1780 1830 tmpW += inlineWidth(o, !appliedStartWidth, true); 1831 1832 if (canHyphenate && w + tmpW > width) { 1833 tryHyphenating(t, f, lastSpace, pos, w + tmpW - additionalTmpW, width, isFixedPitch, collapseWhiteSpace, lastSpaceWordSpacing, lBreak, nextBreakable, hyphenated); 1834 if (hyphenated) 1835 goto end; 1836 } 1781 1837 } else 1782 1838 ASSERT_NOT_REACHED(); -
TabularUnified trunk/WebCore/rendering/RootInlineBox.cpp ¶
r61393 r61548 48 48 void RootInlineBox::detachEllipsisBox(RenderArena* arena) 49 49 { 50 if ( m_hasEllipsisBox) {50 if (hasEllipsisBox()) { 51 51 EllipsisBox* box = gEllipsisBoxMap->take(this); 52 52 box->setParent(0); 53 53 box->destroy(arena); 54 m_hasEllipsisBox = false;54 setHasEllipsisBox(false); 55 55 } 56 56 } … … 63 63 void RootInlineBox::clearTruncation() 64 64 { 65 if ( m_hasEllipsisBox) {65 if (hasEllipsisBox()) { 66 66 detachEllipsisBox(renderer()->renderArena()); 67 67 InlineFlowBox::clearTruncation(); … … 93 93 gEllipsisBoxMap = new EllipsisBoxMap(); 94 94 gEllipsisBoxMap->add(this, ellipsisBox); 95 m_hasEllipsisBox = true;95 setHasEllipsisBox(true); 96 96 97 97 // FIXME: Do we need an RTL version of this? … … 118 118 void RootInlineBox::paintEllipsisBox(RenderObject::PaintInfo& paintInfo, int tx, int ty) const 119 119 { 120 if ( m_hasEllipsisBox && renderer()->shouldPaintWithinRoot(paintInfo) && renderer()->style()->visibility() == VISIBLE &&121 paintInfo.phase == PaintPhaseForeground)120 if (hasEllipsisBox() && renderer()->shouldPaintWithinRoot(paintInfo) && renderer()->style()->visibility() == VISIBLE 121 && paintInfo.phase == PaintPhaseForeground) 122 122 ellipsisBox()->paint(paintInfo, tx, ty); 123 123 } … … 175 175 bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty) 176 176 { 177 if ( m_hasEllipsisBox&& visibleToHitTesting()) {177 if (hasEllipsisBox() && visibleToHitTesting()) { 178 178 if (ellipsisBox()->nodeAtPoint(request, result, x, y, tx, ty)) { 179 179 renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty)); … … 417 417 EllipsisBox* RootInlineBox::ellipsisBox() const 418 418 { 419 if (! m_hasEllipsisBox)419 if (!hasEllipsisBox()) 420 420 return 0; 421 421 return gEllipsisBoxMap->get(this); -
TabularUnified trunk/WebCore/rendering/RootInlineBox.h ¶
r61393 r61548 129 129 virtual void removeLineBoxFromRenderObject(); 130 130 131 protected: 131 private: 132 bool hasEllipsisBox() const { return m_hasEllipsisBoxOrHyphen; } 133 void setHasEllipsisBox(bool hasEllipsisBox) { m_hasEllipsisBoxOrHyphen = hasEllipsisBox; } 134 132 135 // Where this line ended. The exact object and the position within that object are stored so that 133 136 // we can create an InlineIterator beginning just after the end of this line. -
TabularUnified trunk/WebCore/rendering/style/RenderStyle.cpp ¶
r61099 r61548 1 1 /* 2 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 387 387 rareInheritedData->nbspMode != other->rareInheritedData->nbspMode || 388 388 rareInheritedData->khtmlLineBreak != other->rareInheritedData->khtmlLineBreak || 389 rareInheritedData->textSecurity != other->rareInheritedData->textSecurity) 389 rareInheritedData->textSecurity != other->rareInheritedData->textSecurity || 390 rareInheritedData->hyphens != other->rareInheritedData->hyphens || 391 rareInheritedData->hyphenateCharacter != other->rareInheritedData->hyphenateCharacter) 390 392 return StyleDifferenceLayout; 391 393 … … 803 805 } 804 806 807 const AtomicString& RenderStyle::hyphenString() const 808 { 809 ASSERT(hyphens() == HyphensAuto); 810 811 const AtomicString& hyphenateCharacter = rareInheritedData.get()->hyphenateCharacter; 812 if (!hyphenateCharacter.isNull()) 813 return hyphenateCharacter; 814 815 // FIXME: This should depend on locale. 816 DEFINE_STATIC_LOCAL(AtomicString, hyphenMinusString, (&hyphen, 1)); 817 return hyphenMinusString; 818 } 819 805 820 #if ENABLE(DASHBOARD_SUPPORT) 806 821 const Vector<StyleDashboardRegion>& RenderStyle::initialDashboardRegions() -
TabularUnified trunk/WebCore/rendering/style/RenderStyle.h ¶
r61295 r61548 3 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 4 4 * (C) 2000 Dirk Mueller (mueller@kde.org) 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 6 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 7 * … … 648 648 EMatchNearestMailBlockquoteColor matchNearestMailBlockquoteColor() const { return static_cast<EMatchNearestMailBlockquoteColor>(rareNonInheritedData->matchNearestMailBlockquoteColor); } 649 649 const AtomicString& highlight() const { return rareInheritedData->highlight; } 650 Hyphens hyphens() const { return static_cast<Hyphens>(rareInheritedData->hyphens); } 651 const AtomicString& hyphenateCharacter() const { return rareInheritedData->hyphenateCharacter; } 650 652 EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); } 651 653 EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); } … … 980 982 void setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c) { SET_VAR(rareNonInheritedData, matchNearestMailBlockquoteColor, c); } 981 983 void setHighlight(const AtomicString& h) { SET_VAR(rareInheritedData, highlight, h); } 984 void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); } 985 void setHyphenateCharacter(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenateCharacter, h); } 982 986 void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); } 983 987 void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); } … … 1058 1062 const CounterDirectiveMap* counterDirectives() const; 1059 1063 CounterDirectiveMap& accessCounterDirectives(); 1064 1065 const AtomicString& hyphenString() const; 1060 1066 1061 1067 bool inheritedNotEqual(const RenderStyle*) const; … … 1182 1188 static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; } 1183 1189 static const AtomicString& initialHighlight() { return nullAtom; } 1190 static Hyphens initialHyphens() { return HyphensManual; } 1191 static const AtomicString& initialHyphenateCharacter() { return nullAtom; } 1184 1192 static EBorderFit initialBorderFit() { return BorderFitBorder; } 1185 1193 static EResize initialResize() { return RESIZE_NONE; } -
TabularUnified trunk/WebCore/rendering/style/RenderStyleConstants.h ¶
r61376 r61548 407 407 enum ELineClampType { LineClampLineCount, LineClampPercentage }; 408 408 409 enum Hyphens { HyphensNone, HyphensManual, HyphensAuto }; 410 409 411 } // namespace WebCore 410 412 -
TabularUnified trunk/WebCore/rendering/style/StyleRareInheritedData.cpp ¶
r59629 r61548 1 1 /* 2 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 45 45 , userSelect(RenderStyle::initialUserSelect()) 46 46 , colorSpace(DeviceColorSpace) 47 , hyphens(HyphensManual) 47 48 { 48 49 } … … 70 71 , userSelect(o.userSelect) 71 72 , colorSpace(o.colorSpace) 73 , hyphens(o.hyphens) 74 , hyphenateCharacter(o.hyphenateCharacter) 72 75 { 73 76 } … … 108 111 && resize == o.resize 109 112 && userSelect == o.userSelect 110 && colorSpace == o.colorSpace; 113 && colorSpace == o.colorSpace 114 && hyphens == o.hyphens 115 && hyphenateCharacter == o.hyphenateCharacter; 111 116 } 112 117 -
TabularUnified trunk/WebCore/rendering/style/StyleRareInheritedData.h ¶
r59629 r61548 78 78 unsigned userSelect : 1; // EUserSelect 79 79 unsigned colorSpace : 1; // ColorSpace 80 80 unsigned hyphens : 2; // Hyphens 81 82 AtomicString hyphenateCharacter; 83 81 84 private: 82 85 StyleRareInheritedData(); -
TabularUnified trunk/WebKit/mac/ChangeLog ¶
r61545 r61548 1 2010-06-21 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 WebKit part of implementing the 'hyphens' and 'hyphenate-character' properties 6 https://bugs.webkit.org/show_bug.cgi?id=10228 7 8 * WebCoreSupport/WebSystemInterface.mm: 9 (InitWebCoreSystemInterface): Initialize wkGetHyphenationLocationBeforeIndex. 10 1 11 2010-06-21 Satish Sampath <satish@chromium.org> 2 12 -
TabularUnified trunk/WebKit/mac/WebCoreSupport/WebSystemInterface.mm ¶
r61453 r61548 1 1 /* 2 * Copyright 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.2 * Copyright 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 116 116 #endif 117 117 118 INIT(GetHyphenationLocationBeforeIndex); 119 118 120 didInit = true; 119 121 } -
TabularUnified trunk/WebKitLibraries/ChangeLog ¶
r61545 r61548 1 2010-06-21 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 WebKitSystemInterface part of CSS3: Implement the 'hyphens' and 'hyphenate-character' properties 6 https://bugs.webkit.org/show_bug.cgi?id=10228 7 8 * WebKitSystemInterface.h: Added WKGetHyphenationLocationBeforeIndex(). 9 * libWebKitSystemInterfaceLeopard.a: 10 * libWebKitSystemInterfaceSnowLeopard.a: 11 * libWebKitSystemInterfaceTiger.a: 12 1 13 2010-06-21 Satish Sampath <satish@chromium.org> 2 14 -
TabularUnified trunk/WebKitLibraries/WebKitSystemInterface.h ¶
r60978 r61548 301 301 #endif 302 302 303 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index); 304 303 305 #ifdef __cplusplus 304 306 }
Note:
See TracChangeset
for help on using the changeset viewer.