Source/WebCore/ChangeLog

 12011-01-19 takano takumi <takano@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Implement text-combine rendering code
 6 https://bugs.webkit.org/show_bug.cgi?id=50621
 7
 8 Test: fast/text/international/text-combine-image-test.html
 9
 10 * Android.mk: Added RenderCombineText.cpp/h
 11 * CMakeLists.txt: Added RenderCombineText.cpp/h
 12 * GNUmakefile.am: Added RenderCombineText.cpp/h
 13 * WebCore.exp.in:
 14 * WebCore.gypi: Added RenderCombineText.cpp/h
 15 * WebCore.pro: Added RenderCombineText.cpp/h
 16 * WebCore.vcproj/WebCore.vcproj: Added RenderCombineText.cpp/h
 17 * WebCore.xcodeproj/project.pbxproj: Added RenderCombineText.cpp/h
 18 * css/CSSFontFaceSource.cpp:
 19 (WebCore::CSSFontFaceSource::getFontData):
 20 - Added fontDescription.widthVariant to SimpleFontData creation.
 21 * css/CSSStyleSelector.cpp:
 22 (WebCore::CSSStyleSelector::applyProperty):
 23 - Changed to set "Unique" flag to RenderStyle in case of TextCombine.
 24 * dom/Text.cpp:
 25 (WebCore::Text::createRenderer):
 26 - Changed to create RenderCombineText in case of TextCombine.
 27 * loader/cache/CachedFont.cpp:
 28 (WebCore::CachedFont::platformDataFromCustomData):
 29 - Added FontWidthVariant as an argument for FontPlatformData creation.
 30 * loader/cache/CachedFont.h:
 31 - Ditto.
 32 * platform/graphics/Font.h:
 33 (WebCore::Font::widthVariant):
 34 - The accessor to FontWidthVariant member variable.
 35 * platform/graphics/FontCache.cpp:
 36 - Made cache to incorporate FontWidthVariant value.
 37 (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
 38 (WebCore::FontPlatformDataCacheKey::operator==):
 39 (WebCore::computeHash):
 40 (WebCore::FontCache::getCachedFontPlatformData):
 41 * platform/graphics/FontDescription.h:
 42 - Add a member variable that holds a width variant - none, half-width, third-width, and quarter-width.
 43 (WebCore::FontDescription::FontDescription):
 44 (WebCore::FontDescription::widthVariant):
 45 (WebCore::FontDescription::setWidthVariant):
 46 (WebCore::FontDescription::operator==):
 47 * platform/graphics/FontWidthVariant.h: Added.
 48 * platform/graphics/cairo/FontCustomPlatformData.h:
 49 - Changed to carry FontWidthVariant value.
 50 * platform/graphics/cocoa/FontPlatformData.h:
 51 - Changed to carry FontWidthVariant value.
 52 (WebCore::FontPlatformData::FontPlatformData):
 53 (WebCore::FontPlatformData::widthVariant):
 54 (WebCore::FontPlatformData::hash):
 55 (WebCore::FontPlatformData::operator==):
 56 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
 57 (WebCore::FontPlatformData::FontPlatformData):
 58 - Changed to carry FontWidthVariant value.
 59 (WebCore::FontPlatformData::operator=):
 60 - Ditto.
 61 (WebCore::FontPlatformData::ctFont):
 62 - Changed to create CTFont with text spacing variant based on FontWidthVariant.
 63 * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
 64 (WebCore::FontCustomPlatformData::fontPlatformData):
 65 - Changed to carry FontWidthVariant value.
 66 * platform/graphics/haiku/FontCustomPlatformData.cpp:
 67 (WebCore::FontCustomPlatformData::fontPlatformData):
 68 - Changed to carry FontWidthVariant value.
 69 * platform/graphics/haiku/FontCustomPlatformData.h:
 70 * platform/graphics/mac/FontCacheMac.mm:
 71 (WebCore::FontCache::createFontPlatformData):
 72 - Changed to carry FontWidthVariant value.
 73 * platform/graphics/mac/FontCustomPlatformData.cpp:
 74 (WebCore::FontCustomPlatformData::fontPlatformData):
 75 - Changed to carry FontWidthVariant value.
 76 * platform/graphics/mac/FontCustomPlatformData.h:
 77 - Ditto.
 78 * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
 79 (WebCore::shouldUseCoreText):
 80 - Changed to skip CT path when width variant is specified.
 81 * platform/graphics/pango/FontCustomPlatformDataPango.cpp:
 82 (WebCore::FontCustomPlatformData::fontPlatformData):
 83 - Ditto.
 84 * platform/graphics/qt/FontCustomPlatformData.h:
 85 - Ditto.
 86 * platform/graphics/qt/FontCustomPlatformDataQt.cpp:
 87 (WebCore::FontCustomPlatformData::fontPlatformData):
 88 - Ditto.
 89 * platform/graphics/skia/FontCustomPlatformData.cpp:
 90 (WebCore::FontCustomPlatformData::fontPlatformData):
 91 - Ditto.
 92 * platform/graphics/skia/FontCustomPlatformData.h:
 93 - Ditto.
 94 * platform/graphics/win/FontCustomPlatformData.cpp:
 95 (WebCore::FontCustomPlatformData::fontPlatformData):
 96 - Ditto.
 97 * platform/graphics/win/FontCustomPlatformData.h:
 98 - Ditto.
 99 * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
 100 - Ditto.
 101 (WebCore::FontCustomPlatformData::fontPlatformData):
 102 - Ditto.
 103 * platform/graphics/win/FontCustomPlatformDataCairo.h:
 104 - Ditto.
 105 * platform/graphics/wince/FontCustomPlatformData.cpp:
 106 (WebCore::FontCustomPlatformData::fontPlatformData):
 107 - Ditto.
 108 * platform/graphics/wince/FontCustomPlatformData.h:
 109 - Ditto.
 110 * platform/graphics/wx/FontCustomPlatformData.cpp:
 111 (WebCore::FontCustomPlatformData::fontPlatformData):
 112 - Ditto.
 113 * platform/graphics/wx/FontCustomPlatformData.h:
 114 - Ditto.
 115 * rendering/InlineTextBox.cpp:
 116 (WebCore::InlineTextBox::paint):
 117 - In case of RenderCombineText, we don't rotate text even in vertical writing. Also, we render original text
 118 instead of text returned from text().
 119 * rendering/RenderBlockLineLayout.cpp:
 120 (WebCore::textWidth):
 121 - Made to always use the render object's width() in case of TextCombine.
 122 (WebCore::RenderBlock::findNextLineBreak):
 123 - Made to call RenderCombinedText's prepareTextCombine() here.
 124 * rendering/RenderCombineText.cpp: Added. A subclass of RenderText.
 125 (WebCore::RenderCombineText::RenderCombineText):
 126 (WebCore::RenderCombineText::styleDidChange):
 127 - Clear the flag that indicated the font has been prepared for combining. The font will be reinitialized in
 128 the next call of RenderBlock::findNextLineBreak().
 129 (WebCore::RenderCombineText::setTextInternal):
 130 - Ditto.
 131 (WebCore::RenderCombineText::widthFromCache):
 132 - Returns 1-em width in case of font combine.
 133 (WebCore::RenderCombineText::width):
 134 - Ditto.
 135 (WebCore::RenderCombineText::adjustTextOrigin):
 136 - Adjust drawing origin point in case of font combine.
 137 (WebCore::RenderCombineText::charactersToRender):
 138 - Return original text instead of current text in case of font combine.
 139 (WebCore::RenderCombineText::prepareTextCombine):
 140 - This function tries to pack passed text with; 1) the current font as is, 2) the font created
 141 from the descriptor with half-width variant specified, 3) the font with third-width variant, 4) the font
 142 with quarter-width variant.
 143 - If a suitable font successfully found, replace the current font with the new font. If no appropriate font found,
 144 we give up text-combine as the CSS spec describes.
 145 - If a new font found, we replace the text with 0xFFFC. This is needed for a combined text block to be able to
 146 behave like a single character against text decorations.
 147 * rendering/RenderCombineText.h: Added. A subclass of RenderText.
 148 (WebCore::RenderCombineText::rotateWhenVertical):
 149 (WebCore::RenderCombineText::renderName):
 150 (WebCore::toRenderCombineText):
 151 * rendering/RenderText.h:
 152 (WebCore::RenderText::rotateWhenVertical):
 153 - Added to indicate if the text object is needed to be rotated or not.
 154 * rendering/RenderingAllInOne.cpp: Added RenderCombineText.cpp
 155 * rendering/style/RenderStyle.h:
 156 (WebCore::InheritedFlags::hasTextCombine):
 157 - Added for a quick test of TextCombine.
 158
11592010-12-27 Yury Semikhatsky <yurys@chromium.org>
2160
3161 Reviewed by Pavel Feldman.
76216

Source/WebCore/Android.mk

@@LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
664664 rendering/RenderBox.cpp \
665665 rendering/RenderBoxModelObject.cpp \
666666 rendering/RenderButton.cpp \
 667 rendering/RenderCombineText.cpp \
667668 rendering/RenderCounter.cpp \
668669 rendering/RenderEmbeddedObject.cpp \
669670 rendering/RenderFieldset.cpp \
76216

Source/WebCore/CMakeLists.txt

@@SET(WebCore_SOURCES
14671467 rendering/RenderBox.cpp
14681468 rendering/RenderBoxModelObject.cpp
14691469 rendering/RenderButton.cpp
 1470 rendering/RenderCombineText.cpp
14701471 rendering/RenderCounter.cpp
14711472 rendering/RenderDataGrid.cpp
14721473 rendering/RenderDetails.cpp
76216

Source/WebCore/GNUmakefile.am

@@webcore_sources += \
27302730 Source/WebCore/rendering/RenderBR.h \
27312731 Source/WebCore/rendering/RenderButton.cpp \
27322732 Source/WebCore/rendering/RenderButton.h \
 2733 Source/WebCore/rendering/RenderCombineText.cpp \
 2734 Source/WebCore/rendering/RenderCombineText.h \
27332735 Source/WebCore/rendering/RenderCounter.cpp \
27342736 Source/WebCore/rendering/RenderCounter.h \
27352737 Source/WebCore/rendering/RenderDataGrid.cpp \
76216

Source/WebCore/WebCore.exp.in

@@__ZN7WebCore16DeviceMotionData12Accelera
408408__ZN7WebCore16DeviceMotionData12RotationRate6createEbdbdbd
409409__ZN7WebCore16DeviceMotionData6createEN3WTF10PassRefPtrINS0_12AccelerationEEES4_NS2_INS0_12RotationRateEEEbd
410410__ZN7WebCore16FontFallbackList15releaseFontDataEv
411 __ZN7WebCore16FontPlatformDataC1EP6NSFontfbbNS_15FontOrientationE
 411__ZN7WebCore16FontPlatformDataC1EP6NSFontfbbNS_15FontOrientationENS_16FontWidthVariantE
412412__ZN7WebCore16FontPlatformDataD1Ev
413413__ZN7WebCore16HTMLInputElement13setAutofilledEb
414414__ZN7WebCore16LegacyWebArchive19createFromSelectionEPNS_5FrameE
76216

Source/WebCore/WebCore.gypi

38103810 'rendering/RenderBoxModelObject.h',
38113811 'rendering/RenderButton.cpp',
38123812 'rendering/RenderButton.h',
 3813 'rendering/RenderCombineText.cpp',
 3814 'rendering/RenderCombineText.h',
38133815 'rendering/RenderCounter.cpp',
38143816 'rendering/RenderCounter.h',
38153817 'rendering/RenderDataGrid.cpp',
76216

Source/WebCore/WebCore.pro

@@SOURCES += \
13061306 rendering/RenderBoxModelObject.cpp \
13071307 rendering/RenderBR.cpp \
13081308 rendering/RenderButton.cpp \
 1309 rendering/RenderCombineText.cpp \
13091310 rendering/RenderCounter.cpp \
13101311 rendering/RenderDataGrid.cpp \
13111312 rendering/RenderDetails.cpp \

@@HEADERS += \
22732274 rendering/RenderBoxModelObject.h \
22742275 rendering/RenderBR.h \
22752276 rendering/RenderButton.h \
 2277 rendering/RenderCombineText.h \
22762278 rendering/RenderCounter.h \
22772279 rendering/RenderDataGrid.h \
22782280 rendering/RenderDetails.h \
76216

Source/WebCore/WebCore.vcproj/WebCore.vcproj

3302633026 >
3302733027 </File>
3302833028 <File
 33029 RelativePath="..\rendering\RenderCombineText.cpp"
 33030 >
 33031 <FileConfiguration
 33032 Name="Debug|Win32"
 33033 ExcludedFromBuild="true"
 33034 >
 33035 <Tool
 33036 Name="VCCLCompilerTool"
 33037 />
 33038 </FileConfiguration>
 33039 <FileConfiguration
 33040 Name="Release|Win32"
 33041 ExcludedFromBuild="true"
 33042 >
 33043 <Tool
 33044 Name="VCCLCompilerTool"
 33045 />
 33046 </FileConfiguration>
 33047 <FileConfiguration
 33048 Name="Debug_Cairo_CFLite|Win32"
 33049 ExcludedFromBuild="true"
 33050 >
 33051 <Tool
 33052 Name="VCCLCompilerTool"
 33053 />
 33054 </FileConfiguration>
 33055 <FileConfiguration
 33056 Name="Release_Cairo_CFLite|Win32"
 33057 ExcludedFromBuild="true"
 33058 >
 33059 <Tool
 33060 Name="VCCLCompilerTool"
 33061 />
 33062 </FileConfiguration>
 33063 <FileConfiguration
 33064 Name="Debug_All|Win32"
 33065 ExcludedFromBuild="true"
 33066 >
 33067 <Tool
 33068 Name="VCCLCompilerTool"
 33069 />
 33070 </FileConfiguration>
 33071 <FileConfiguration
 33072 Name="Release_LTCG|Win32"
 33073 ExcludedFromBuild="true"
 33074 >
 33075 <Tool
 33076 Name="VCCLCompilerTool"
 33077 />
 33078 </FileConfiguration>
 33079 </File>
 33080 <File
 33081 RelativePath="..\rendering\RenderCombineText.h"
 33082 >
 33083 </File>
 33084 <File
3302933085 RelativePath="..\rendering\RenderCounter.cpp"
3303033086 >
3303133087 <FileConfiguration
76216

Source/WebCore/WebCore.xcodeproj/project.pbxproj

56905690 F5C041E70FFCA96D00839D4A /* JSHTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041E20FFCA96D00839D4A /* JSHTMLDataListElement.h */; };
56915691 F5D3A57C106B83B300545297 /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D3A57A106B83B300545297 /* DateComponents.cpp */; };
56925692 F5D3A57D106B83B300545297 /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = F5D3A57B106B83B300545297 /* DateComponents.h */; settings = {ATTRIBUTES = (Private, ); }; };
 5693 F764AD6E12E839DD004CFB2A /* RenderCombineText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F764AD6C12E839DD004CFB2A /* RenderCombineText.cpp */; };
 5694 F764AD6F12E839DD004CFB2A /* RenderCombineText.h in Headers */ = {isa = PBXBuildFile; fileRef = F764AD6D12E839DD004CFB2A /* RenderCombineText.h */; };
 5695 F764AD7112E839FE004CFB2A /* FontWidthVariant.h in Headers */ = {isa = PBXBuildFile; fileRef = F764AD7012E839FE004CFB2A /* FontWidthVariant.h */; settings = {ATTRIBUTES = (Private, ); }; };
56935696 F7A034C4126BF6BE007DC19E /* FontOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = F7A034C3126BF6BE007DC19E /* FontOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
56945697 F916C48D0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */; };
56955698 F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */; };

95389541 A5AFB34E115151A700B045CB /* StepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StepRange.h; sourceTree = "<group>"; };
95399542 A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyEventCocoa.h; path = cocoa/KeyEventCocoa.h; sourceTree = "<group>"; };
95409543 A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = KeyEventCocoa.mm; path = cocoa/KeyEventCocoa.mm; sourceTree = "<group>"; };
9541  A6148A6112E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMHTMLKeygenElementInternal.h; path = DOMHTMLKeygenElementInternal.h; sourceTree = "<group>"; };
9542  A6148A6512E41D940044A784 /* DOMHTMLKeygenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMHTMLKeygenElement.h; path = DOMHTMLKeygenElement.h; sourceTree = "<group>"; };
9543  A6148A6612E41D940044A784 /* DOMHTMLKeygenElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DOMHTMLKeygenElement.mm; path = DOMHTMLKeygenElement.mm; sourceTree = "<group>"; };
9544  A6148A7612E41E3B0044A784 /* JSHTMLKeygenElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSHTMLKeygenElement.cpp; path = JSHTMLKeygenElement.cpp; sourceTree = "<group>"; };
9545  A6148A7712E41E3B0044A784 /* JSHTMLKeygenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSHTMLKeygenElement.h; path = JSHTMLKeygenElement.h; sourceTree = "<group>"; };
 9544 A6148A6112E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLKeygenElementInternal.h; sourceTree = "<group>"; };
 9545 A6148A6512E41D940044A784 /* DOMHTMLKeygenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLKeygenElement.h; sourceTree = "<group>"; };
 9546 A6148A6612E41D940044A784 /* DOMHTMLKeygenElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLKeygenElement.mm; sourceTree = "<group>"; };
 9547 A6148A7612E41E3B0044A784 /* JSHTMLKeygenElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLKeygenElement.cpp; sourceTree = "<group>"; };
 9548 A6148A7712E41E3B0044A784 /* JSHTMLKeygenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLKeygenElement.h; sourceTree = "<group>"; };
95469549 A6148A7F12E41ED10044A784 /* HTMLKeygenElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLKeygenElement.idl; sourceTree = "<group>"; };
95479550 A622A8F5122C44A600A785B3 /* BindingSecurity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BindingSecurity.h; path = generic/BindingSecurity.h; sourceTree = "<group>"; };
95489551 A622A8F6122C44A600A785B3 /* BindingSecurityBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BindingSecurityBase.cpp; path = generic/BindingSecurityBase.cpp; sourceTree = "<group>"; };

1207012073 F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1207112074 F5D3A57A106B83B300545297 /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };
1207212075 F5D3A57B106B83B300545297 /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };
 12076 F764AD6C12E839DD004CFB2A /* RenderCombineText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderCombineText.cpp; sourceTree = "<group>"; };
 12077 F764AD6D12E839DD004CFB2A /* RenderCombineText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderCombineText.h; sourceTree = "<group>"; };
 12078 F764AD7012E839FE004CFB2A /* FontWidthVariant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontWidthVariant.h; sourceTree = "<group>"; };
1207312079 F7A034C3126BF6BE007DC19E /* FontOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontOrientation.h; sourceTree = "<group>"; };
1207412080 F8216299029F4FB501000131 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1207512081 F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequestProgressEvent.cpp; sourceTree = "<group>"; };

1745017456 B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */,
1745117457 37202198106213C600F25C4B /* FontSmoothingMode.h */,
1745217458 3784C34A0E11AA34007D8D48 /* FontTraitsMask.h */,
 17459 F764AD7012E839FE004CFB2A /* FontWidthVariant.h */,
1745317460 BCE04C930DAFF902007A0F41 /* GeneratedImage.cpp */,
1745417461 BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */,
1745517462 BCE04C890DAFF7A0007A0F41 /* Generator.h */,

1869918706 BCEA4825097D93020094C9E4 /* RenderBR.h */,
1870018707 BCEA4826097D93020094C9E4 /* RenderButton.cpp */,
1870118708 BCEA4827097D93020094C9E4 /* RenderButton.h */,
 18709 F764AD6C12E839DD004CFB2A /* RenderCombineText.cpp */,
 18710 F764AD6D12E839DD004CFB2A /* RenderCombineText.h */,
1870218711 9392F1430AD185FE00691BD4 /* RenderCounter.cpp */,
1870318712 9392F1410AD185F400691BD4 /* RenderCounter.h */,
1870418713 BC77CEC70FF01CBE0070887B /* RenderDataGrid.cpp */,

2239422403 A6148A6212E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h in Headers */,
2239522404 A6148A6712E41D940044A784 /* DOMHTMLKeygenElement.h in Headers */,
2239622405 A6148A7912E41E3B0044A784 /* JSHTMLKeygenElement.h in Headers */,
 22406 F764AD6F12E839DD004CFB2A /* RenderCombineText.h in Headers */,
 22407 F764AD7112E839FE004CFB2A /* FontWidthVariant.h in Headers */,
2239722408 );
2239822409 runOnlyForDeploymentPostprocessing = 0;
2239922410 };

2508625097 7AA365EE12E7265400DCA242 /* InspectorRuntimeAgent.cpp in Sources */,
2508725098 A6148A6812E41D940044A784 /* DOMHTMLKeygenElement.mm in Sources */,
2508825099 A6148A7812E41E3B0044A784 /* JSHTMLKeygenElement.cpp in Sources */,
 25100 F764AD6E12E839DD004CFB2A /* RenderCombineText.cpp in Sources */,
2508925101 );
2509025102 runOnlyForDeploymentPostprocessing = 0;
2509125103 };
76216

Source/WebCore/css/CSSFontFaceSource.cpp

@@SimpleFontData* CSSFontFaceSource::getFo
115115 }
116116
117117 // See if we have a mapping in our FontData cache.
118  unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 3 | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
 118 unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 16 | fontDescription.widthVariant() << 8 | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
119119 if (SimpleFontData* cachedData = m_fontDataTable.get(hashKey))
120120 return cachedData;
121121

@@SimpleFontData* CSSFontFaceSource::getFo
162162 if (!m_font->ensureCustomFontData())
163163 return 0;
164164
165  fontData.set(new SimpleFontData(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, fontDescription.orientation(), fontDescription.renderingMode()), true, false));
 165 fontData.set(new SimpleFontData(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false));
166166 }
167167 } else {
168168#if ENABLE(SVG_FONTS)
76216

Source/WebCore/css/CSSStyleSelector.cpp

@@void CSSStyleSelector::applyProperty(int
57605760
57615761 case CSSPropertyWebkitTextCombine:
57625762 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(textCombine, TextCombine)
 5763 if (m_style->hasTextCombine())
 5764 m_style->setUnique(); // The style could be modified in RenderCombineText depending on text metrics.
57635765 return;
57645766
57655767 case CSSPropertyWebkitTextEmphasisPosition:
76216

Source/WebCore/dom/Text.cpp

2323#include "Text.h"
2424
2525#include "ExceptionCode.h"
 26#include "RenderCombineText.h"
2627#include "RenderText.h"
2728#include "TextBreakIterator.h"
2829#include <wtf/text/CString.h>

@@bool Text::rendererIsNeeded(RenderStyle
237238 return true;
238239}
239240
240 RenderObject* Text::createRenderer(RenderArena* arena, RenderStyle*)
 241RenderObject* Text::createRenderer(RenderArena* arena, RenderStyle* style)
241242{
242243#if ENABLE(SVG)
243244 Node* parentOrHost = parentOrHostNode();

@@RenderObject* Text::createRenderer(Rende
248249 )
249250 return new (arena) RenderSVGInlineText(this, dataImpl());
250251#endif
251 
252  return new (arena) RenderText(this, dataImpl());
 252
 253 if (!style->hasTextCombine())
 254 return new (arena) RenderText(this, dataImpl());
 255
 256 return new (arena) RenderCombineText(this, dataImpl());
253257}
254258
255259void Text::attach()
76216

Source/WebCore/loader/cache/CachedFont.cpp

@@bool CachedFont::ensureCustomFontData()
117117 return m_fontData;
118118}
119119
120 FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, FontRenderingMode renderingMode)
 120FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant, FontRenderingMode renderingMode)
121121{
122122#if ENABLE(SVG_FONTS)
123123 if (m_externalSVGDocument)

@@FontPlatformData CachedFont::platformDat
125125#endif
126126#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
127127 ASSERT(m_fontData);
128  return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, orientation, renderingMode);
 128 return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, orientation, widthVariant, renderingMode);
129129#else
130130 return FontPlatformData();
131131#endif
76216

Source/WebCore/loader/cache/CachedFont.h

2929#include "CachedResource.h"
3030#include "FontOrientation.h"
3131#include "FontRenderingMode.h"
 32#include "FontWidthVariant.h"
3233#include <wtf/Vector.h>
3334
3435#if ENABLE(SVG_FONTS)

@@public:
6364 void beginLoadIfNeeded(CachedResourceLoader* dl);
6465
6566 bool ensureCustomFontData();
66  FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
 67 FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
6768
6869#if ENABLE(SVG_FONTS)
6970 bool isSVGFont() const { return m_isSVGFont; }
76216

Source/WebCore/platform/graphics/Font.h

@@public:
124124
125125 bool italic() const { return m_fontDescription.italic(); }
126126 FontWeight weight() const { return m_fontDescription.weight(); }
 127 FontWidthVariant widthVariant() const { return m_fontDescription.widthVariant(); }
127128
128129 bool isPlatformFont() const { return m_isPlatformFont; }
129130
76216

Source/WebCore/platform/graphics/FontCache.cpp

@@FontCache::FontCache()
5555
5656struct FontPlatformDataCacheKey : FastAllocBase {
5757 FontPlatformDataCacheKey(const AtomicString& family = AtomicString(), unsigned size = 0, unsigned weight = 0, bool italic = false,
58  bool isPrinterFont = false, FontRenderingMode renderingMode = NormalRenderingMode, FontOrientation orientation = Horizontal)
 58 bool isPrinterFont = false, FontRenderingMode renderingMode = NormalRenderingMode, FontOrientation orientation = Horizontal, FontWidthVariant widthVariant = RegularWidth)
5959 : m_size(size)
6060 , m_weight(weight)
6161 , m_family(family)

@@struct FontPlatformDataCacheKey : FastAl
6363 , m_printerFont(isPrinterFont)
6464 , m_renderingMode(renderingMode)
6565 , m_orientation(orientation)
 66 , m_widthVariant(widthVariant)
6667 {
6768 }
6869

@@struct FontPlatformDataCacheKey : FastAl
7374 {
7475 return equalIgnoringCase(m_family, other.m_family) && m_size == other.m_size &&
7576 m_weight == other.m_weight && m_italic == other.m_italic && m_printerFont == other.m_printerFont &&
76  m_renderingMode == other.m_renderingMode && m_orientation == other.m_orientation;
 77 m_renderingMode == other.m_renderingMode && m_orientation == other.m_orientation && m_widthVariant == other.m_widthVariant;
7778 }
7879
7980 unsigned m_size;

@@struct FontPlatformDataCacheKey : FastAl
8384 bool m_printerFont;
8485 FontRenderingMode m_renderingMode;
8586 FontOrientation m_orientation;
 87 FontWidthVariant m_widthVariant;
8688
8789private:
8890 static unsigned hashTableDeletedSize() { return 0xFFFFFFFFU; }

@@private:
9092
9193inline unsigned computeHash(const FontPlatformDataCacheKey& fontKey)
9294{
93  unsigned hashCodes[4] = {
 95 unsigned hashCodes[5] = {
9496 CaseFoldingHash::hash(fontKey.m_family),
9597 fontKey.m_size,
9698 fontKey.m_weight,
 99 fontKey.m_widthVariant,
97100 static_cast<unsigned>(fontKey.m_orientation) << 3 | static_cast<unsigned>(fontKey.m_italic) << 2 | static_cast<unsigned>(fontKey.m_printerFont) << 1 | static_cast<unsigned>(fontKey.m_renderingMode)
98101 };
99102 return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);

@@FontPlatformData* FontCache::getCachedFo
193196 }
194197
195198 FontPlatformDataCacheKey key(familyName, fontDescription.computedPixelSize(), fontDescription.weight(), fontDescription.italic(),
196  fontDescription.usePrinterFont(), fontDescription.renderingMode(), fontDescription.orientation());
 199 fontDescription.usePrinterFont(), fontDescription.renderingMode(), fontDescription.orientation(), fontDescription.widthVariant());
197200 FontPlatformData* result = 0;
198201 bool foundResult;
199202 FontPlatformDataCache::iterator it = gFontPlatformDataCache->find(key);
76216

Source/WebCore/platform/graphics/FontDescription.h

3030#include "FontRenderingMode.h"
3131#include "FontSmoothingMode.h"
3232#include "FontTraitsMask.h"
 33#include "FontWidthVariant.h"
3334#include "TextRenderingMode.h"
3435
3536namespace WebCore {

@@public:
5758 : m_specifiedSize(0)
5859 , m_computedSize(0)
5960 , m_orientation(Horizontal)
 61 , m_widthVariant(RegularWidth)
6062 , m_italic(false)
6163 , m_smallCaps(false)
6264 , m_isAbsoluteSize(false)

@@public:
9799 FontTraitsMask traitsMask() const;
98100 bool isSpecifiedFont() const { return m_isSpecifiedFont; }
99101 FontOrientation orientation() const { return m_orientation; }
 102 FontWidthVariant widthVariant() const { return m_widthVariant; }
100103
101104 void setFamily(const FontFamily& family) { m_familyList = family; }
102105 void setComputedSize(float s) { m_computedSize = s; }

@@public:
117120 void setTextRenderingMode(TextRenderingMode rendering) { m_textRendering = rendering; }
118121 void setIsSpecifiedFont(bool isSpecifiedFont) { m_isSpecifiedFont = isSpecifiedFont; }
119122 void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
 123 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; }
120124
121125private:
122126 FontFamily m_familyList; // The list of font families to be used.

@@private:
126130 float m_computedSize; // Computed size adjusted for the minimum font size and the zoom factor.
127131
128132 FontOrientation m_orientation;
 133
 134 FontWidthVariant m_widthVariant;
129135
130136 bool m_italic : 1;
131137 bool m_smallCaps : 1;

@@inline bool FontDescription::operator==(
162168 && m_fontSmoothing == other.m_fontSmoothing
163169 && m_textRendering == other.m_textRendering
164170 && m_isSpecifiedFont == other.m_isSpecifiedFont
165  && m_orientation == other.m_orientation;
 171 && m_orientation == other.m_orientation
 172 && m_widthVariant == other.m_widthVariant;
166173}
167174
168175}
76216

Source/WebCore/platform/graphics/FontWidthVariant.h

 1/*
 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef FontWidthVariant_h
 27#define FontWidthVariant_h
 28
 29namespace WebCore {
 30
 31enum FontWidthVariant { RegularWidth, HalfWidth, ThirdWidth, QuarterWidth };
 32
 33} // namespace WebCore
 34
 35#endif // FontWidthVariant_h
0

Source/WebCore/platform/graphics/cairo/FontCustomPlatformData.h

2424
2525#include "FontOrientation.h"
2626#include "FontRenderingMode.h"
 27#include "FontWidthVariant.h"
2728#include <wtf/Forward.h>
2829#include <wtf/Noncopyable.h>
2930

@@struct FontCustomPlatformData : Noncopya
3940public:
4041 FontCustomPlatformData(FT_Face, SharedBuffer*);
4142 ~FontCustomPlatformData();
42  FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
 43 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
4344 static bool supportsFormat(const String&);
4445
4546private:
76216

Source/WebCore/platform/graphics/cocoa/FontPlatformData.h

2525#define FontPlatformData_h
2626
2727#include "FontOrientation.h"
 28#include "FontWidthVariant.h"
2829#include <wtf/text/StringImpl.h>
2930
3031#ifdef __OBJC__

@@inline CTFontRef toCTFontRef(NSFont *nsF
5960
6061class FontPlatformData {
6162 public:
62  FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation = Horizontal)
 63 FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation = Horizontal, FontWidthVariant widthVariant = RegularWidth)
6364 : m_syntheticBold(syntheticBold)
6465 , m_syntheticOblique(syntheticOblique)
6566 , m_orientation(orientation)
6667 , m_size(size)
 68 , m_widthVariant(widthVariant)
6769 , m_font(0)
6870#ifdef BUILDING_ON_TIGER
6971 , m_cgFont(0)

@@class FontPlatformData {
7274 {
7375 }
7476
75  FontPlatformData(NSFont *nsFont, float size, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal);
 77 FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
7678
77  FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation)
 79 FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
7880 : m_syntheticBold(syntheticBold)
7981 , m_syntheticOblique(syntheticOblique)
8082 , m_orientation(orientation)
8183 , m_size(size)
 84 , m_widthVariant(widthVariant)
8285 , m_font(0)
8386 , m_cgFont(cgFont)
8487 , m_isColorBitmapFont(false)

@@class FontPlatformData {
9699 bool syntheticBold() const { return m_syntheticBold; }
97100 bool syntheticOblique() const { return m_syntheticOblique; }
98101 FontOrientation orientation() const { return m_orientation; }
 102 FontWidthVariant widthVariant() const { return m_widthVariant; }
99103
100104 bool m_syntheticBold;
101105 bool m_syntheticOblique;
102106 FontOrientation m_orientation;
103107
104108 float m_size;
 109
 110 FontWidthVariant m_widthVariant;
105111
106112 unsigned hash() const
107113 {
108114 ASSERT(m_font != 0 || m_cgFont == 0);
109  uintptr_t hashCodes[2] = { (uintptr_t)m_font, m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique };
 115 uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique };
110116 return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
111117 }
112118

@@class FontPlatformData {
115121 bool operator==(const FontPlatformData& other) const
116122 {
117123 return m_font == other.m_font && m_syntheticBold == other.m_syntheticBold && m_syntheticOblique == other.m_syntheticOblique &&
118  m_cgFont == other.m_cgFont && m_size == other.m_size && m_orientation == other.m_orientation;
 124 m_cgFont == other.m_cgFont && m_size == other.m_size && m_orientation == other.m_orientation && m_widthVariant == other.m_widthVariant;
119125 }
120126
121127 NSFont *font() const { return m_font; }
76216

Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm

3030
3131namespace WebCore {
3232
 33// These CoreText Text Spacing feature selectors are not defined in CoreText...
 34enum TextSpacingCTFeatureSelector { TextSpacingProportional, TextSpacingFullWidth, TextSpacingHalfWidth, TextSpacingThirdWidth, TextSpacingQuarterWidth };
 35
3336#if PLATFORM(MAC)
3437void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*& outNSFont, CGFontRef& cgFont)
3538{

@@void FontPlatformData::loadFont(NSFont*
4245}
4346#endif // PLATFORM(MAC)
4447
45 FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation)
 48FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
4649 : m_syntheticBold(syntheticBold)
4750 , m_syntheticOblique(syntheticOblique)
4851 , m_size(size)
 52 , m_widthVariant(widthVariant)
4953 , m_font(nsFont)
5054#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
5155 // FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might

@@FontPlatformData::FontPlatformData(const
7983 m_syntheticBold = f.m_syntheticBold;
8084 m_syntheticOblique = f.m_syntheticOblique;
8185 m_size = f.m_size;
 86 m_widthVariant = f.m_widthVariant;
8287 m_cgFont = f.m_cgFont;
8388 m_isColorBitmapFont = f.m_isColorBitmapFont;
8489 m_orientation = f.m_orientation;

@@const FontPlatformData& FontPlatformData
99104 m_syntheticBold = f.m_syntheticBold;
100105 m_syntheticOblique = f.m_syntheticOblique;
101106 m_size = f.m_size;
 107 m_widthVariant = f.m_widthVariant;
102108 m_cgFont = f.m_cgFont;
103109 if (m_font == f.m_font)
104110 return *this;

@@bool FontPlatformData::allowsLigatures()
167173
168174CTFontRef FontPlatformData::ctFont() const
169175{
170  if (m_font)
171  return toCTFontRef(m_font);
172  if (!m_CTFont)
173  m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, 0));
 176 if (m_widthVariant == RegularWidth) {
 177 if (m_font)
 178 return toCTFontRef(m_font);
 179 if (!m_CTFont)
 180 m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, 0));
 181 return m_CTFont.get();
 182 }
 183
 184 if (!m_CTFont) {
 185 RetainPtr<CTFontRef> sourceFont(AdoptCF, CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, 0));
 186 RetainPtr<CTFontDescriptorRef> sourceDescriptor(AdoptCF, CTFontCopyFontDescriptor(sourceFont.get()));
 187 int featureTypeValue = kTextSpacingType;
 188 int featureSelectorValue;
 189 switch(m_widthVariant) {
 190 case HalfWidth:
 191 featureSelectorValue = TextSpacingHalfWidth;
 192 break;
 193 case ThirdWidth:
 194 featureSelectorValue = TextSpacingThirdWidth;
 195 break;
 196 case QuarterWidth:
 197 featureSelectorValue = TextSpacingQuarterWidth;
 198 break;
 199 default:
 200 ASSERT_NOT_REACHED();
 201 return 0;
 202 }
 203 RetainPtr<CFNumberRef> featureType(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureTypeValue));
 204 RetainPtr<CFNumberRef> featureSelector(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureSelectorValue));
 205 RetainPtr<CTFontDescriptorRef> newDescriptor(AdoptCF, CTFontDescriptorCreateCopyWithFeature(sourceDescriptor.get(), featureType.get(), featureSelector.get()));
 206 CTFontRef newFont = CTFontCreateWithFontDescriptor(newDescriptor.get(), m_size, 0);
 207 if (newFont)
 208 m_CTFont.adoptCF(newFont);
 209 else
 210 m_CTFont = sourceFont;
 211 }
174212 return m_CTFont.get();
175213}
176214
76216

Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp

@@FontCustomPlatformData::~FontCustomPlatf
5959 cairo_font_face_destroy(m_fontFace);
6060}
6161
62 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
 62FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
6363{
6464 return FontPlatformData(m_fontFace, size, bold, italic);
6565}
76216

Source/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp

@@FontCustomPlatformData::~FontCustomPlatf
3131{
3232}
3333
34 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
 34FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
3535{
3636 return FontPlatformData(size, bold, italic);
3737}
76216

Source/WebCore/platform/graphics/haiku/FontCustomPlatformData.h

2323
2424#include "FontOrientation.h"
2525#include "FontRenderingMode.h"
 26#include "FontWidthVariant.h"
2627#include <wtf/Forward.h>
2728#include <wtf/Noncopyable.h>
2829

@@namespace WebCore {
3839
3940 static bool supportsFormat(const String&);
4041
41  FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
 42 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
4243 };
4344
4445 FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer*);
76216

Source/WebCore/platform/graphics/mac/FontCacheMac.mm

@@FontPlatformData* FontCache::createFontP
211211 bool syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight);
212212 bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
213213
214  return new FontPlatformData(platformFont, size, syntheticBold, syntheticOblique, fontDescription.orientation());
 214 return new FontPlatformData(platformFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant());
215215}
216216
217217} // namespace WebCore
76216

Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp

@@FontCustomPlatformData::~FontCustomPlatf
3838 CGFontRelease(m_cgFont);
3939}
4040
41 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation, FontRenderingMode)
 41FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant, FontRenderingMode)
4242{
43  return FontPlatformData(m_cgFont, size, bold, italic, orientation);
 43 return FontPlatformData(m_cgFont, size, bold, italic, orientation, widthVariant);
4444}
4545
4646FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
76216

Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h

2323
2424#include "FontOrientation.h"
2525#include "FontRenderingMode.h"
 26#include "FontWidthVariant.h"
2627#include <CoreFoundation/CFBase.h>
2728#include <wtf/Forward.h>
2829#include <wtf/Noncopyable.h>

@@struct FontCustomPlatformData : Noncopya
4546
4647 ~FontCustomPlatformData();
4748
48  FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
 49 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
4950
5051 static bool supportsFormat(const String&);
5152
76216

Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp

@@namespace WebCore {
3939#ifndef BUILDING_ON_TIGER
4040static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
4141{
42  if (fontData->orientation() == Vertical && !fontData->isBrokenIdeographFont()) {
43  // Ideographs don't have a vertical variant.
 42 if (fontData->platformData().widthVariant() != RegularWidth || (fontData->orientation() == Vertical && !fontData->isBrokenIdeographFont())) {
 43 // Ideographs don't have a vertical variant or width variants.
4444 for (unsigned i = 0; i < bufferLength; ++i) {
4545 if (!Font::isCJKIdeograph(buffer[i]))
4646 return true;
76216

Source/WebCore/platform/graphics/pango/FontCustomPlatformDataPango.cpp

@@FontCustomPlatformData::~FontCustomPlatf
3030{
3131}
3232
33 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
 33FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
3434{
3535 return FontPlatformData(m_fontFace, size, bold, italic);
3636}
76216

Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h

2424
2525#include "FontOrientation.h"
2626#include "FontRenderingMode.h"
 27#include "FontWidthVariant.h"
2728#include <wtf/Forward.h>
2829#include <wtf/Noncopyable.h>
2930

@@struct FontCustomPlatformData : Noncopya
3839 // for use with QFontDatabase::addApplicationFont/removeApplicationFont
3940 int m_handle;
4041
41  FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
 42 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
4243
4344 static bool supportsFormat(const String&);
4445};
76216

Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp

@@FontCustomPlatformData::~FontCustomPlatf
3434 QFontDatabase::removeApplicationFont(m_handle);
3535}
3636
37 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
 37FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
3838{
3939 QFont font;
4040 font.setFamily(QFontDatabase::applicationFontFamilies(m_handle)[0]);
76216

Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp

@@FontCustomPlatformData::~FontCustomPlatf
6565#endif
6666}
6767
68 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation, FontRenderingMode mode)
 68FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant, FontRenderingMode mode)
6969{
7070#if OS(WINDOWS)
7171 ASSERT(m_fontReference);
76216

Source/WebCore/platform/graphics/skia/FontCustomPlatformData.h

3434
3535#include "FontOrientation.h"
3636#include "FontRenderingMode.h"
 37#include "FontWidthVariant.h"
3738#include <wtf/Forward.h>
3839#include <wtf/Noncopyable.h>
3940

@@struct FontCustomPlatformData : Noncopya
6364
6465 ~FontCustomPlatformData();
6566
66  FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal,
 67 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth,
6768 FontRenderingMode = NormalRenderingMode);
6869
6970 static bool supportsFormat(const String&);
76216

Source/WebCore/platform/graphics/win/FontCustomPlatformData.cpp

@@FontCustomPlatformData::~FontCustomPlatf
5959 }
6060}
6161
62 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode renderingMode)
 62FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode renderingMode)
6363{
6464 ASSERT(m_fontReference);
6565 ASSERT(T2embedLibrary());
76216

Source/WebCore/platform/graphics/win/FontCustomPlatformData.h

2323
2424#include "FontOrientation.h"
2525#include "FontRenderingMode.h"
 26#include "FontWidthVariant.h"
2627#include "PlatformString.h"
2728#include <wtf/Forward.h>
2829#include <wtf/Noncopyable.h>

@@struct FontCustomPlatformData : Noncopya
4344
4445 ~FontCustomPlatformData();
4546
46  FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
 47 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
4748
4849 static bool supportsFormat(const String&);
4950
76216

Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp

@@FontCustomPlatformData::~FontCustomPlatf
3232 cairo_font_face_destroy(m_fontFace);
3333}
3434
35 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation)
 35FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant)
3636{
3737 return FontPlatformData(m_fontFace, size, bold, italic);
3838}
76216

Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h

@@struct FontCustomPlatformData : Noncopya
4040 }
4141 ~FontCustomPlatformData();
4242
43  FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal);
 43 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
4444
4545 static bool supportsFormat(const String&);
4646
76216

Source/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp

@@FontCustomPlatformData::~FontCustomPlatf
4545 g_customFontCache->unregisterFont(m_name);
4646}
4747
48 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode renderingMode)
 48FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode renderingMode)
4949{
5050 FontDescription fontDesc;
5151 fontDesc.setComputedSize(size);
76216

Source/WebCore/platform/graphics/wince/FontCustomPlatformData.h

2323
2424#include "FontDescription.h"
2525#include "FontRenderingMode.h"
 26#include "FontWidthVariant.h"
2627#include "PlatformString.h"
2728#include <wtf/Noncopyable.h>
2829

@@namespace WebCore {
4546
4647 ~FontCustomPlatformData();
4748
48  FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation fontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
 49 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
4950
5051 static bool supportsFormat(const String&);
5152
76216

Source/WebCore/platform/graphics/wx/FontCustomPlatformData.cpp

@@FontCustomPlatformData::~FontCustomPlatf
3131{
3232}
3333
34 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
 34FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
3535{
3636 return FontPlatformData(size, bold, italic);
3737}
76216

Source/WebCore/platform/graphics/wx/FontCustomPlatformData.h

2323
2424#include "FontOrientation.h"
2525#include "FontRenderingMode.h"
 26#include "FontWidthVariant.h"
2627#include <wtf/Forward.h>
2728#include <wtf/Noncopyable.h>
2829

@@namespace WebCore {
3839
3940 static bool supportsFormat(const String&);
4041
41  FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
 42 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
4243 };
4344
4445 FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer*);
76216

Source/WebCore/rendering/InlineTextBox.cpp

3636#include "PaintInfo.h"
3737#include "RenderArena.h"
3838#include "RenderBlock.h"
 39#include "RenderCombineText.h"
3940#include "RenderRubyRun.h"
4041#include "RenderRubyText.h"
4142#include "RenderTheme.h"

@@void InlineTextBox::paint(PaintInfo& pai
487488 IntRect boxRect(boxOrigin, IntSize(logicalWidth(), logicalHeight()));
488489 IntPoint textOrigin = IntPoint(boxOrigin.x(), boxOrigin.y() + styleToUse->font().ascent());
489490
490  if (!isHorizontal()) {
 491 bool doRotation = !isHorizontal() && textRenderer()->rotateWhenVertical();
 492 if (doRotation) {
491493 context->save();
492494 context->translate(boxRect.x(), boxRect.bottom());
493495 context->rotate(static_cast<float>(deg2rad(90.)));

@@void InlineTextBox::paint(PaintInfo& pai
503505 int d = styleToUse->textDecorationsInEffect();
504506 const Font& font = styleToUse->font();
505507
 508 if (styleToUse->hasTextCombine()) {
 509 RenderCombineText* t = toRenderCombineText(textRenderer());
 510 t->adjustTextOrigin(textOrigin, boxRect);
 511 }
 512
506513 // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
507514 // and composition underlines.
508515 if (paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseTextClip && !isPrinting) {

@@void InlineTextBox::paint(PaintInfo& pai
602609 }
603610 }
604611
605  const UChar* characters = textRenderer()->text()->characters() + m_start;
606612 int length = m_len;
 613 const UChar* characters;
 614 if (!styleToUse->hasTextCombine())
 615 characters = textRenderer()->text()->characters() + m_start;
 616 else {
 617 RenderCombineText* t = toRenderCombineText(textRenderer());
 618 characters = t->charactersToRender(m_start, length);
 619 }
 620
607621 BufferForAppendingHyphen charactersWithHyphen;
608622 if (hasHyphen())
609623 adjustCharactersAndLengthForHyphen(charactersWithHyphen, styleToUse, characters, length);

@@void InlineTextBox::paint(PaintInfo& pai
704718 }
705719 }
706720
707  if (!isHorizontal())
 721 if (doRotation)
708722 context->restore();
709723}
710724
76216

Source/WebCore/rendering/RenderBlockLineLayout.cpp

2929#include "InlineTextBox.h"
3030#include "Logging.h"
3131#include "RenderArena.h"
 32#include "RenderCombineText.h"
3233#include "RenderInline.h"
3334#include "RenderLayer.h"
3435#include "RenderListMarker.h"

@@void RenderBlock::fitBelowFloats(int wid
13811382
13821383static inline unsigned textWidth(RenderText* text, unsigned from, unsigned len, const Font& font, int xPos, bool isFixedPitch, bool collapseWhiteSpace)
13831384{
1384  if (isFixedPitch || (!from && len == text->textLength()))
 1385 if (isFixedPitch || (!from && len == text->textLength()) || text->style()->hasTextCombine())
13851386 return text->width(from, len, font, xPos);
13861387 return font.width(TextRun(text->characters() + from, len, !collapseWhiteSpace, xPos));
13871388}

@@InlineIterator RenderBlock::findNextLine
16331634 bool isSVGText = t->isSVGInlineText();
16341635#endif
16351636
 1637 RenderStyle* style = t->style(firstLine);
 1638 if (style->hasTextCombine()) {
 1639 RenderCombineText* t = toRenderCombineText(o);
 1640 t->prepareTextCombine();
 1641 }
 1642
16361643 int strlen = t->textLength();
16371644 int len = strlen - pos;
16381645 const UChar* str = t->characters();
16391646
1640  RenderStyle* style = t->style(firstLine);
16411647 const Font& f = style->font();
16421648 bool isFixedPitch = f.isFixedPitch();
16431649 bool canHyphenate = style->hyphens() == HyphensAuto && WebCore::canHyphenate(style->hyphenationLocale());
76216

Source/WebCore/rendering/RenderCombineText.cpp

 1/*
 2 * (C) 1999 Lars Knoll (knoll@kde.org)
 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
 7 *
 8 * This library is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU Library General Public
 10 * License as published by the Free Software Foundation; either
 11 * version 2 of the License, or (at your option) any later version.
 12 *
 13 * This library is distributed in the hope that it will be useful,
 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 16 * Library General Public License for more details.
 17 *
 18 * You should have received a copy of the GNU Library General Public License
 19 * along with this library; see the file COPYING.LIB. If not, write to
 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 21 * Boston, MA 02110-1301, USA.
 22 *
 23 */
 24
 25#include "config.h"
 26#include "RenderCombineText.h"
 27
 28#include "TextRun.h"
 29
 30namespace WebCore {
 31
 32const float textCombineMargin = 1.1; // Allow em + 10% margin
 33
 34RenderCombineText::RenderCombineText(Node* node, PassRefPtr<StringImpl> str)
 35 : RenderText(node, str)
 36 , m_combinedTextWidth(0)
 37 , m_isCombined(false)
 38 , m_fontNeedsUpdated(false)
 39{
 40}
 41
 42void RenderCombineText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 43{
 44 RenderText::styleDidChange(diff, oldStyle);
 45
 46 m_fontNeedsUpdated = true;
 47}
 48
 49void RenderCombineText::setTextInternal(PassRefPtr<StringImpl> text)
 50{
 51 RenderText::setTextInternal(text);
 52
 53 m_fontNeedsUpdated = true;
 54}
 55
 56ALWAYS_INLINE int RenderCombineText::widthFromCache(const Font& f, int start, int len, int xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 57{
 58 if (m_isCombined)
 59 return f.size();
 60
 61 return RenderText::widthFromCache(f, start, len, xPos, fallbackFonts, glyphOverflow);
 62}
 63
 64unsigned RenderCombineText::width(unsigned from, unsigned len, const Font& f, int xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 65{
 66 if (!characters())
 67 return 0;
 68
 69 if (m_isCombined)
 70 return f.size();
 71
 72 return RenderText::width(from, len, f, xPos, fallbackFonts, glyphOverflow);
 73}
 74
 75void RenderCombineText::adjustTextOrigin(IntPoint& textOrigin, IntRect boxRect) const
 76{
 77 if (m_isCombined)
 78 textOrigin.move(boxRect.height() / 2 - ceilf(m_combinedTextWidth) / 2, style()->font().pixelSize());
 79}
 80
 81const UChar* RenderCombineText::charactersToRender(int start, int& length) const
 82{
 83 if (m_isCombined) {
 84 length = originalText()->length();
 85 return originalText()->characters();
 86 }
 87
 88 return text()->characters() + start;
 89}
 90
 91void RenderCombineText::prepareTextCombine()
 92{
 93 if (!m_fontNeedsUpdated)
 94 return;
 95
 96 m_isCombined = false;
 97 m_fontNeedsUpdated = false;
 98
 99 // Spec says text-combine works only in vertical writing mode.
 100 if (style()->isHorizontalWritingMode())
 101 return;
 102
 103 TextRun run = TextRun(String(text()));
 104 float emWidth = style()->font().fontDescription().computedSize() * textCombineMargin;
 105 m_combinedTextWidth = style()->font().floatWidth(run);
 106 m_isCombined = m_combinedTextWidth <= emWidth;
 107
 108 if (!m_isCombined) {
 109 // Need to try compressed glyphs.
 110 static const FontWidthVariant widthVariants[] = { HalfWidth, ThirdWidth, QuarterWidth };
 111 FontDescription compressedFontDescription = style()->font().fontDescription();
 112 for (size_t i = 0 ; i < WTF_ARRAY_LENGTH(widthVariants) ; ++i) {
 113 compressedFontDescription.setWidthVariant(widthVariants[i]);
 114 Font compressedFont = Font(compressedFontDescription, style()->font().letterSpacing(), style()->font().wordSpacing());
 115 compressedFont.update(style()->font().fontSelector());
 116 float runWidth = compressedFont.floatWidth(run);
 117 if (runWidth <= emWidth) {
 118 m_combinedTextWidth = runWidth;
 119 m_isCombined = true;
 120
 121 // Replace my font with the new one.
 122 if (style()->setFontDescription(compressedFontDescription))
 123 style()->font().update(style()->font().fontSelector());
 124
 125 break;
 126 }
 127 }
 128 }
 129
 130 if (m_isCombined) {
 131 static const UChar uc = objectReplacementCharacter;
 132 DEFINE_STATIC_LOCAL(String, objectReplacementCharacterString, (&uc, 1));
 133 RenderText::setTextInternal(objectReplacementCharacterString.impl());
 134 }
 135}
 136
 137} // namespace WebCore
0

Source/WebCore/rendering/RenderCombineText.h

 1/*
 2 * (C) 1999 Lars Knoll (knoll@kde.org)
 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
 5 *
 6 * This library is free software; you can redistribute it and/or
 7 * modify it under the terms of the GNU Library General Public
 8 * License as published by the Free Software Foundation; either
 9 * version 2 of the License, or (at your option) any later version.
 10 *
 11 * This library is distributed in the hope that it will be useful,
 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 14 * Library General Public License for more details.
 15 *
 16 * You should have received a copy of the GNU Library General Public License
 17 * along with this library; see the file COPYING.LIB. If not, write to
 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 19 * Boston, MA 02110-1301, USA.
 20 *
 21 */
 22
 23#ifndef RenderCombineText_h
 24#define RenderCombineText_h
 25
 26#include "RenderText.h"
 27
 28namespace WebCore {
 29
 30class RenderCombineText : public RenderText {
 31public:
 32 RenderCombineText(Node*, PassRefPtr<StringImpl>);
 33
 34 virtual unsigned width(unsigned from, unsigned len, const Font&, int xPos, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
 35 virtual bool rotateWhenVertical() const { return !m_isCombined; }
 36
 37 void prepareTextCombine();
 38 void adjustTextOrigin(IntPoint& textOrigin, IntRect boxRect) const;
 39 const UChar* charactersToRender(int start, int& length) const;
 40
 41private:
 42 virtual const char* renderName() const { return "RenderCombineText"; }
 43
 44 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 45 virtual void setTextInternal(PassRefPtr<StringImpl>);
 46 virtual int widthFromCache(const Font&, int start, int len, int xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*) const;
 47
 48 float m_combinedTextWidth;
 49 bool m_isCombined : 1;
 50 bool m_fontNeedsUpdated : 1;
 51};
 52
 53inline RenderCombineText* toRenderCombineText(RenderObject* object)
 54{
 55 ASSERT(!object || object->isText());
 56 return static_cast<RenderCombineText*>(object);
 57}
 58
 59inline const RenderCombineText* toRenderCombineText(const RenderObject* object)
 60{
 61 ASSERT(!object || object->isText());
 62 return static_cast<const RenderCombineText*>(object);
 63}
 64
 65// This will catch anyone doing an unnecessary cast.
 66void toRenderCombineText(const RenderCombineText*);
 67
 68} // namespace WebCore
 69
 70#endif // RenderCombineText_h
0

Source/WebCore/rendering/RenderText.h

@@public:
125125 virtual void computePreferredLogicalWidths(int leadWidth);
126126 bool isAllCollapsibleWhitespace();
127127
 128 virtual bool rotateWhenVertical() const { return true; }
 129
128130protected:
129131 virtual void styleWillChange(StyleDifference, const RenderStyle*) { }
130132 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);

@@protected:
134136
135137 virtual InlineTextBox* createTextBox(); // Subclassed by SVG.
136138
 139 virtual int widthFromCache(const Font&, int start, int len, int xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*) const;
 140
137141private:
138142 void computePreferredLogicalWidths(int leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow&);
139143

@@private:
148152
149153 void deleteTextBoxes();
150154 bool containsOnlyWhitespace(unsigned from, unsigned len) const;
151  int widthFromCache(const Font&, int start, int len, int xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*) const;
152155 bool isAllASCII() const { return m_isAllASCII; }
153156 void updateNeedsTranscoding();
154157
76216

Source/WebCore/rendering/RenderingAllInOne.cpp

4545#include "RenderBox.cpp"
4646#include "RenderBoxModelObject.cpp"
4747#include "RenderButton.cpp"
 48#include "RenderCombineText.cpp"
4849#include "RenderCounter.cpp"
4950#include "RenderDataGrid.cpp"
5051#include "RenderDetails.cpp"
76216

Source/WebCore/rendering/style/RenderStyle.h

@@public:
727727 bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
728728
729729 TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInheritedData->m_textCombine); }
 730 bool hasTextCombine() const { return textCombine() != TextCombineNone; }
730731 // End CSS3 Getters
731732
732733 // Apple-specific property getter methods
76216

LayoutTests/ChangeLog

 12011-01-19 takano takumi <takano@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Implement text-combine rendering code
 6 https://bugs.webkit.org/show_bug.cgi?id=50621
 7
 8 * fast/text/international/text-combine-image-test.html: Added.
 9 * platform/mac/fast/text/international/text-combine-image-test-expected.checksum: Added.
 10 * platform/mac/fast/text/international/text-combine-image-test-expected.png: Added.
 11 * platform/mac/fast/text/international/text-combine-image-test-expected.txt: Added.
 12
1132010-12-27 Yury Semikhatsky <yurys@chromium.org>
214
315 Reviewed by Pavel Feldman.
76216

LayoutTests/fast/text/international/text-combine-image-test.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<meta http-equiv="content-type" content="text/html; charset=utf-8">
 5<title>text-combine image test</title>
 6<style>
 7body {
 8 -webkit-writing-mode: vertical-rl;
 9}
 10
 11#Hira24 {
 12 font-family: "HiraMinPro-W3";
 13 font-size: 24pt;
 14}
 15
 16#Times24 {
 17 font-family: "Times";
 18 font-size: 24pt;
 19}
 20
 21#combine {
 22 -webkit-text-combine: horizontal;
 23}
 24
 25</style>
 26</head>
 27<body>
 28<hr>
 29<span id="Hira24">OFF=西暦2010å¹´1月20æ—¥365回</span>
 30<hr>
 31<span id="Hira24"><span id="combine">ON</span>=西暦<span id="combine">2010</span>å¹´<span id="combine">1</span>月<span id="combine">20</span>æ—¥<span id="combine">365</span>回</span>
 32<hr>
 33<span id="Times24"><span id="combine">Times</span>=西暦<span id="combine">2010</span>å¹´<span id="combine">1</span>月<span id="combine">20</span>æ—¥<span id="combine">365</span>回</span>
 34<hr>
 35</body>
 36</html>
0

LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.checksum

 1b0709e78f01487b8a0bdefb69f1f0347
02\ No newline at end of file
0

LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (632,0) size 168x600
 4 RenderBlock {HTML} at (0,0) size 168x600
 5 RenderBody {BODY} at (8,8) size 152x584
 6 RenderBlock {HR} at (0,8) size 2x568 [border: (1px inset #000000)]
 7 RenderBlock (anonymous) at (2,0) size 48x584
 8 RenderInline {SPAN} at (0,0) size 32x474
 9 RenderText {#text} at (8,0) size 32x474
 10 text run at (8,0) width 474: "OFF=\x{897F}\x{66A6}2010\x{5E74}1\x{6708}20\x{65E5}365\x{56DE}"
 11 RenderText {#text} at (0,0) size 0x0
 12 RenderBlock {HR} at (50,8) size 2x568 [border: (1px inset #000000)]
 13 RenderBlock (anonymous) at (52,0) size 48x584
 14 RenderInline {SPAN} at (0,0) size 32x380
 15 RenderInline {SPAN} at (0,0) size 32x32
 16 RenderCombineText {#text} at (8,0) size 32x32
 17 text run at (8,0) width 32: "\x{FFFC}"
 18 RenderText {#text} at (8,32) size 32x88
 19 text run at (8,32) width 88: "=\x{897F}\x{66A6}"
 20 RenderInline {SPAN} at (0,0) size 32x32
 21 RenderCombineText {#text} at (8,120) size 32x32
 22 text run at (8,120) width 32: "\x{FFFC}"
 23 RenderText {#text} at (8,152) size 32x33
 24 text run at (8,152) width 33: "\x{5E74}"
 25 RenderInline {SPAN} at (0,0) size 32x32
 26 RenderCombineText {#text} at (8,185) size 32x32
 27 text run at (8,185) width 32: "\x{FFFC}"
 28 RenderText {#text} at (8,217) size 32x33
 29 text run at (8,217) width 33: "\x{6708}"
 30 RenderInline {SPAN} at (0,0) size 32x32
 31 RenderCombineText {#text} at (8,250) size 32x32
 32 text run at (8,250) width 32: "\x{FFFC}"
 33 RenderText {#text} at (8,282) size 32x33
 34 text run at (8,282) width 33: "\x{65E5}"
 35 RenderInline {SPAN} at (0,0) size 32x32
 36 RenderCombineText {#text} at (8,315) size 32x32
 37 text run at (8,315) width 32: "\x{FFFC}"
 38 RenderText {#text} at (8,347) size 32x33
 39 text run at (8,347) width 33: "\x{56DE}"
 40 RenderText {#text} at (0,0) size 0x0
 41 RenderBlock {HR} at (100,8) size 2x568 [border: (1px inset #000000)]
 42 RenderBlock (anonymous) at (102,0) size 48x584
 43 RenderInline {SPAN} at (0,0) size 37x472
 44 RenderInline {SPAN} at (0,0) size 37x80
 45 RenderCombineText {#text} at (5,0) size 37x80
 46 text run at (5,0) width 80: "Times"
 47 RenderText {#text} at (5,80) size 37x84
 48 text run at (5,80) width 84: "=\x{897F}\x{66A6}"
 49 RenderInline {SPAN} at (0,0) size 37x64
 50 RenderCombineText {#text} at (5,164) size 37x64
 51 text run at (5,164) width 64: "2010"
 52 RenderText {#text} at (5,228) size 37x33
 53 text run at (5,228) width 33: "\x{5E74}"
 54 RenderInline {SPAN} at (0,0) size 37x32
 55 RenderCombineText {#text} at (5,261) size 37x32
 56 text run at (5,261) width 32: "\x{FFFC}"
 57 RenderText {#text} at (5,293) size 37x33
 58 text run at (5,293) width 33: "\x{6708}"
 59 RenderInline {SPAN} at (0,0) size 37x32
 60 RenderCombineText {#text} at (5,326) size 37x32
 61 text run at (5,326) width 32: "\x{FFFC}"
 62 RenderText {#text} at (5,358) size 37x33
 63 text run at (5,358) width 33: "\x{65E5}"
 64 RenderInline {SPAN} at (0,0) size 37x48
 65 RenderCombineText {#text} at (5,391) size 37x48
 66 text run at (5,391) width 48: "365"
 67 RenderText {#text} at (5,439) size 37x33
 68 text run at (5,439) width 33: "\x{56DE}"
 69 RenderText {#text} at (0,0) size 0x0
 70 RenderBlock {HR} at (150,8) size 2x568 [border: (1px inset #000000)]
0

LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.png

INVALID: Image lacks a checksum. This will fail with a MISSING error in run-webkit-tests. Always generate new png files using run-webkit-tests.