WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-204276-20210923054843.patch (text/plain), 55.36 KB, created by
Kiet Ho
on 2021-09-23 03:48:44 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Kiet Ho
Created:
2021-09-23 03:48:44 PDT
Size:
55.36 KB
patch
obsolete
>Subversion Revision: 282922 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 8506ef88f0b58d10656d928ec205b1bb87dcc39e..0350328a7287c4b3f7820f1c70fd5b8aac1d7848 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,13 @@ >+2021-09-23 Kiet Ho <tho22@apple.com> >+ >+ Implement the 'ic' unit from CSS Values 4 >+ https://bugs.webkit.org/show_bug.cgi?id=204276 >+ <rdar://problem/57256127> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/unicode/CharacterNames.h: add CJK water glyph (U+6C34) constant. >+ > 2021-09-22 Chris Dumez <cdumez@apple.com> > > Drop makeRef() and use Ref { } instead >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6b38609b4ffec7175782031ce781a98c0cf8ee8d..21f1e460f76ca698de342d5ee77edf0da2728177 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,60 @@ >+2021-09-23 Kiet Ho <tho22@apple.com> >+ >+ Implement the 'ic' unit from CSS Values 4 >+ https://bugs.webkit.org/show_bug.cgi?id=204276 >+ <rdar://problem/57256127> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Tests: imported/w3c/web-platform-tests/css/css-values/ic-unit-013.html >+ imported/w3c/web-platform-tests/css/css-values/ic-unit-014.html >+ >+ * css/CSSPrimitiveValue.cpp: >+ (WebCore::isValidCSSUnitTypeForDoubleConversion): >+ (WebCore::isStringType): >+ (WebCore::CSSPrimitiveValue::cleanup): >+ (WebCore::CSSPrimitiveValue::computeUnzoomedNonCalcLengthDouble): >+ (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble): >+ (WebCore::CSSPrimitiveValue::unitTypeString): >+ (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): >+ (WebCore::CSSPrimitiveValue::equals const): >+ (WebCore::CSSPrimitiveValue::collectDirectComputationalDependencies const): >+ * css/CSSPrimitiveValue.h: >+ (WebCore::CSSPrimitiveValue::isFontRelativeLength): >+ (WebCore::CSSPrimitiveValue::isLength): >+ * css/CSSPrimitiveValueMappings.h: >+ (WebCore::CSSPrimitiveValue::convertingToLengthRequiresNonNullStyle const): >+ * css/CSSUnits.cpp: >+ (WebCore::unitCategory): >+ (WebCore::operator<<): >+ * css/CSSUnits.h: >+ * css/DeprecatedCSSOMPrimitiveValue.cpp: >+ (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType const): >+ * css/calc/CSSCalcCategoryMapping.cpp: >+ (WebCore::calcUnitCategory): >+ (WebCore::calculationCategoryForCombination): >+ (WebCore::hasDoubleValue): >+ * css/parser/CSSParserToken.cpp: >+ (WebCore::cssPrimitiveValueUnitFromTrie): >+ * css/parser/CSSPropertyParserHelpers.cpp: >+ (WebCore::CSSPropertyParserHelpers::consumeLengthRawWithKnownTokenTypeDimension): >+ * css/parser/SizesAttributeParser.cpp: >+ (WebCore::SizesAttributeParser::computeLength): >+ * platform/graphics/Font.cpp: >+ (WebCore::Font::platformGlyphInit): simplyfy logic, reorder misplaced comment. >+ * platform/graphics/Font.h: remove property `m_zeroGlyph` only used once in >+ WebCore::Font::platformGlyphInit. Remove unused getters adjustedSpaceWidth(), >+ setSpaceWidths(), setSpaceGlyph(), setZeroWidthSpaceGlyph(), zeroGlyph(), setZeroGlyph(). >+ (WebCore::Font::spaceWidth const): >+ (WebCore::Font::spaceGlyph const): >+ (WebCore::Font::zeroWidthSpaceGlyph const): >+ (WebCore::Font::isZeroWidthSpaceGlyph const): >+ * platform/graphics/FontMetrics.h: >+ (WebCore::FontMetrics::ideogramWidth const): add metric containing the width of an ideogram >+ glyph in the font. This width is approximated from the width of the CJK water glyph (U+6C34). >+ (WebCore::FontMetrics::setIdeogramWidth): >+ (WebCore::FontMetrics::reset): >+ > 2021-09-22 Myles C. Maxfield <mmaxfield@apple.com> > > [Cocoa] Hook up palettes to CoreText >diff --git a/Source/WTF/wtf/unicode/CharacterNames.h b/Source/WTF/wtf/unicode/CharacterNames.h >index 8d6301d5f8fc5adc19cac8f7d481d19943da9983..3bb2f65d930fb98bf70dda3cb28a01a2ca227528 100644 >--- a/Source/WTF/wtf/unicode/CharacterNames.h >+++ b/Source/WTF/wtf/unicode/CharacterNames.h >@@ -50,6 +50,7 @@ constexpr UChar bullet = 0x2022; > constexpr UChar bullseye = 0x25CE; > constexpr UChar byteOrderMark = 0xFEFF; > constexpr UChar carriageReturn = 0x000D; >+constexpr UChar cjkWater = 0x6C34; > constexpr UChar combiningEnclosingKeycap = 0x20E3; > constexpr UChar deleteCharacter = 0x007F; > constexpr UChar ethiopicPrefaceColon = 0x1366; >@@ -129,6 +130,7 @@ using WTF::Unicode::bullet; > using WTF::Unicode::bullseye; > using WTF::Unicode::byteOrderMark; > using WTF::Unicode::carriageReturn; >+using WTF::Unicode::cjkWater; > using WTF::Unicode::combiningEnclosingKeycap; > using WTF::Unicode::deleteCharacter; > using WTF::Unicode::ethiopicPrefaceColon; >diff --git a/Source/WebCore/css/CSSPrimitiveValue.cpp b/Source/WebCore/css/CSSPrimitiveValue.cpp >index 1ef7dd1449438b0ab20bef7ed56649801445e930..b8cc3a22afae13d388b92a95331f444f97f7de21 100644 >--- a/Source/WebCore/css/CSSPrimitiveValue.cpp >+++ b/Source/WebCore/css/CSSPrimitiveValue.cpp >@@ -56,6 +56,7 @@ static inline bool isValidCSSUnitTypeForDoubleConversion(CSSUnitType unitType) > case CSSUnitType::CSS_CALC_PERCENTAGE_WITH_LENGTH: > case CSSUnitType::CSS_CALC_PERCENTAGE_WITH_NUMBER: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > case CSSUnitType::CSS_CM: > case CSSUnitType::CSS_DEG: > case CSSUnitType::CSS_DIMENSION: >@@ -130,6 +131,7 @@ static inline bool isStringType(CSSUnitType type) > case CSSUnitType::CSS_CALC_PERCENTAGE_WITH_LENGTH: > case CSSUnitType::CSS_CALC_PERCENTAGE_WITH_NUMBER: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > case CSSUnitType::CSS_CM: > case CSSUnitType::CSS_COUNTER: > case CSSUnitType::CSS_DEG: >@@ -493,6 +495,7 @@ void CSSPrimitiveValue::cleanup() > case CSSUnitType::CSS_EXS: > case CSSUnitType::CSS_REMS: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > case CSSUnitType::CSS_PX: > case CSSUnitType::CSS_CM: > case CSSUnitType::CSS_MM: >@@ -613,6 +616,14 @@ double CSSPrimitiveValue::computeUnzoomedNonCalcLengthDouble(CSSUnitType primiti > case CSSUnitType::CSS_CHS: > ASSERT(fontMetrics); > return fontMetrics->zeroWidth() * value; >+ case CSSUnitType::CSS_ICS: >+ ASSERT(fontMetrics); >+ >+ if (std::optional<float> width = fontMetrics->ideogramWidth()) >+ return *width * value; >+ >+ // Fallback to 1ic = 1em, per specification. >+ return computeUnzoomedNonCalcLengthDouble(CSSUnitType::CSS_EMS, value, propertyToCompute, fontMetrics, fontDescription, rootFontDescription, renderView); > case CSSUnitType::CSS_PX: > return value; > case CSSUnitType::CSS_CM: >@@ -684,6 +695,11 @@ double CSSPrimitiveValue::computeNonCalcLengthDouble(const CSSToLengthConversion > value = computeUnzoomedNonCalcLengthDouble(primitiveType, value, conversionData.propertyToCompute(), &conversionData.style()->fontMetrics()); > break; > >+ case CSSUnitType::CSS_ICS: >+ ASSERT(conversionData.style()); >+ value = computeUnzoomedNonCalcLengthDouble(primitiveType, value, conversionData.propertyToCompute(), &conversionData.style()->fontMetrics(), &conversionData.style()->fontDescription()); >+ break; >+ > case CSSUnitType::CSS_PX: > case CSSUnitType::CSS_CM: > case CSSUnitType::CSS_MM: >@@ -982,6 +998,7 @@ String CSSPrimitiveValue::unitTypeString(CSSUnitType unitType) > case CSSUnitType::CSS_TURN: return "turn"; > case CSSUnitType::CSS_REMS: return "rem"; > case CSSUnitType::CSS_CHS: return "ch"; >+ case CSSUnitType::CSS_ICS: return "ic"; > > case CSSUnitType::CSS_UNKNOWN: > case CSSUnitType::CSS_NUMBER: >@@ -1030,6 +1047,8 @@ ALWAYS_INLINE String CSSPrimitiveValue::formatNumberForCustomCSSText() const > return formatNumberValue("rem"); > case CSSUnitType::CSS_CHS: > return formatNumberValue("ch"); >+ case CSSUnitType::CSS_ICS: >+ return formatNumberValue("ic"); > case CSSUnitType::CSS_PX: > return formatNumberValue("px"); > case CSSUnitType::CSS_CM: >@@ -1174,6 +1193,7 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const > case CSSUnitType::CSS_EXS: > case CSSUnitType::CSS_REMS: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > case CSSUnitType::CSS_PX: > case CSSUnitType::CSS_CM: > case CSSUnitType::CSS_DPPX: >@@ -1252,6 +1272,7 @@ void CSSPrimitiveValue::collectDirectComputationalDependencies(HashSet<CSSProper > case CSSUnitType::CSS_QUIRKY_EMS: > case CSSUnitType::CSS_EXS: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > values.add(CSSPropertyFontSize); > break; > case CSSUnitType::CSS_LHS: >diff --git a/Source/WebCore/css/CSSPrimitiveValue.h b/Source/WebCore/css/CSSPrimitiveValue.h >index ed2b607bb05d1d49d0d800c299c24b46c3c8de18..665bfddfffde2c5807ff8ba920e52a31e599611f 100644 >--- a/Source/WebCore/css/CSSPrimitiveValue.h >+++ b/Source/WebCore/css/CSSPrimitiveValue.h >@@ -282,6 +282,7 @@ constexpr bool CSSPrimitiveValue::isFontRelativeLength(CSSUnitType type) > || type == CSSUnitType::CSS_RLHS > || type == CSSUnitType::CSS_REMS > || type == CSSUnitType::CSS_CHS >+ || type == CSSUnitType::CSS_ICS > || type == CSSUnitType::CSS_QUIRKY_EMS; > } > >@@ -297,6 +298,7 @@ constexpr bool CSSPrimitiveValue::isLength(CSSUnitType type) > || type == CSSUnitType::CSS_PC > || type == CSSUnitType::CSS_REMS > || type == CSSUnitType::CSS_CHS >+ || type == CSSUnitType::CSS_ICS > || type == CSSUnitType::CSS_Q > || type == CSSUnitType::CSS_LHS > || type == CSSUnitType::CSS_RLHS >diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h >index b3ab34dd192204db5336edb3453eeee876b622d3..284fa3c180a666f4f4bb0951210ef12875eaa14c 100644 >--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h >+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h >@@ -4408,6 +4408,7 @@ inline bool CSSPrimitiveValue::convertingToLengthRequiresNonNullStyle(int length > case CSSUnitType::CSS_EMS: > case CSSUnitType::CSS_EXS: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > case CSSUnitType::CSS_LHS: > return lengthConversion & (FixedIntegerConversion | FixedFloatConversion); > default: >diff --git a/Source/WebCore/css/CSSUnits.cpp b/Source/WebCore/css/CSSUnits.cpp >index b5893dfbeac0b4917415805c854d0ad2632cd6c1..f4377e4fea7a90b355064432de284915cb7ae170 100644 >--- a/Source/WebCore/css/CSSUnits.cpp >+++ b/Source/WebCore/css/CSSUnits.cpp >@@ -39,6 +39,7 @@ CSSUnitCategory unitCategory(CSSUnitType type) > case CSSUnitType::CSS_PT: > case CSSUnitType::CSS_PC: > case CSSUnitType::CSS_Q: >+ case CSSUnitType::CSS_ICS: > return CSSUnitCategory::Length; > case CSSUnitType::CSS_MS: > case CSSUnitType::CSS_S: >@@ -150,6 +151,7 @@ TextStream& operator<<(TextStream& ts, CSSUnitType unitType) > case CSSUnitType::CSS_TURN: ts << "turn"; break; > case CSSUnitType::CSS_REMS: ts << "rems"; break; > case CSSUnitType::CSS_CHS: ts << "chs"; break; >+ case CSSUnitType::CSS_ICS: ts << "ics"; break; > case CSSUnitType::CSS_COUNTER_NAME: ts << "counter_name"; break; > case CSSUnitType::CSS_SHAPE: ts << "shape"; break; > case CSSUnitType::CSS_QUAD: ts << "quad"; break; >diff --git a/Source/WebCore/css/CSSUnits.h b/Source/WebCore/css/CSSUnits.h >index a56edb9a2632164e5c4027e74440c78e81582f27..a72d85ea0123a26b4351ee16ca8f7c92cd784ca9 100644 >--- a/Source/WebCore/css/CSSUnits.h >+++ b/Source/WebCore/css/CSSUnits.h >@@ -75,6 +75,7 @@ enum class CSSUnitType : uint8_t { > CSS_TURN, > CSS_REMS, > CSS_CHS, >+ CSS_ICS, > > CSS_COUNTER_NAME, > >diff --git a/Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp b/Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp >index 85b48030ab2d8df5c832fbda0ccdba7bb9777e8f..b0b7ffd93586bd77c63beab92e5306fc25fe00b1 100644 >--- a/Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp >+++ b/Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp >@@ -43,6 +43,7 @@ unsigned short DeprecatedCSSOMPrimitiveValue::primitiveType() const > case CSSUnitType::CSS_CALC_PERCENTAGE_WITH_LENGTH: return 115; > case CSSUnitType::CSS_CALC_PERCENTAGE_WITH_NUMBER: return 114; > case CSSUnitType::CSS_CHS: return 109; >+ case CSSUnitType::CSS_ICS: return CSS_UNKNOWN; > case CSSUnitType::CSS_CM: return CSS_CM; > case CSSUnitType::CSS_COUNTER: return CSS_COUNTER; > case CSSUnitType::CSS_COUNTER_NAME: return 110; >diff --git a/Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp b/Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp >index d746247d872e4d8069a73213c7982a2d1216743f..5a38ba0f659f888f61f5096454d2ca816f1508df 100644 >--- a/Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp >+++ b/Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp >@@ -49,6 +49,7 @@ CalculationCategory calcUnitCategory(CSSUnitType type) > case CSSUnitType::CSS_RLHS: > case CSSUnitType::CSS_REMS: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > case CSSUnitType::CSS_VW: > case CSSUnitType::CSS_VH: > case CSSUnitType::CSS_VMIN: >@@ -104,6 +105,7 @@ CalculationCategory calculationCategoryForCombination(CSSUnitType type) > case CSSUnitType::CSS_REMS: > case CSSUnitType::CSS_RLHS: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > case CSSUnitType::CSS_VW: > case CSSUnitType::CSS_VH: > case CSSUnitType::CSS_VMIN: >@@ -139,6 +141,7 @@ bool hasDoubleValue(CSSUnitType type) > case CSSUnitType::CSS_EMS: > case CSSUnitType::CSS_EXS: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > case CSSUnitType::CSS_REMS: > case CSSUnitType::CSS_PX: > case CSSUnitType::CSS_CM: >diff --git a/Source/WebCore/css/parser/CSSParserToken.cpp b/Source/WebCore/css/parser/CSSParserToken.cpp >index f94cc377315f37dcde930d8fc7200861173cf75c..54a75ee2538dc50f57a6f82af60128497923636a 100644 >--- a/Source/WebCore/css/parser/CSSParserToken.cpp >+++ b/Source/WebCore/css/parser/CSSParserToken.cpp >@@ -83,8 +83,12 @@ CSSUnitType cssPrimitiveValueUnitFromTrie(const CharacterType* data, unsigned le > return CSSUnitType::CSS_HZ; > break; > case 'i': >- if (toASCIILower(data[1]) == 'n') >+ switch (toASCIILower(data[1])) { >+ case 'c': >+ return CSSUnitType::CSS_ICS; >+ case 'n': > return CSSUnitType::CSS_IN; >+ } > break; > case 'l': > if (toASCIILower(data[1]) == 'h' && RuntimeEnabledFeatures::sharedFeatures().lineHeightUnitsEnabled()) >diff --git a/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp b/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp >index 364ad660eca9cc08ffef8fd49b270669980e93dc..3cb5d9c3478bc4467aabacd4ba61ec8ba40ea1e2 100644 >--- a/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp >+++ b/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp >@@ -473,6 +473,7 @@ static std::optional<LengthRaw> consumeLengthRawWithKnownTokenTypeDimension(CSSP > case CSSUnitType::CSS_LHS: > case CSSUnitType::CSS_RLHS: > case CSSUnitType::CSS_CHS: >+ case CSSUnitType::CSS_ICS: > case CSSUnitType::CSS_EXS: > case CSSUnitType::CSS_PX: > case CSSUnitType::CSS_CM: >diff --git a/Source/WebCore/css/parser/SizesAttributeParser.cpp b/Source/WebCore/css/parser/SizesAttributeParser.cpp >index 648b49a39f59abe877c1ba849f159c883851a4ff..ab8e936605f55d3c2e2e4e8f048b9f643735804b 100644 >--- a/Source/WebCore/css/parser/SizesAttributeParser.cpp >+++ b/Source/WebCore/css/parser/SizesAttributeParser.cpp >@@ -57,7 +57,7 @@ float SizesAttributeParser::computeLength(double value, CSSUnitType type, const > // the pointer to it for the duration of the unit evaluation. This is acceptible because the style always comes from the > // RenderView, which has its font information hardcoded in resolveForDocument() to be -webkit-standard, whose operations > // don't require a font selector. >- if (type == CSSUnitType::CSS_EXS || type == CSSUnitType::CSS_CHS) { >+ if (type == CSSUnitType::CSS_EXS || type == CSSUnitType::CSS_CHS || type == CSSUnitType::CSS_ICS) { > RefPtr<FontSelector> fontSelector = style.fontCascade().fontSelector(); > style.fontCascade().update(nullptr); > float result = CSSPrimitiveValue::computeNonCalcLengthDouble(conversionData, type, value); >diff --git a/Source/WebCore/platform/graphics/Font.cpp b/Source/WebCore/platform/graphics/Font.cpp >index ded4de5d13663b80522d053c820d427a421c4bc1..6ff8015fcfc02dfcc2f247212fa4dbd2abb6389e 100644 >--- a/Source/WebCore/platform/graphics/Font.cpp >+++ b/Source/WebCore/platform/graphics/Font.cpp >@@ -139,19 +139,12 @@ void Font::platformGlyphInit() > auto* glyphPageZeroWidthSpace = glyphPage(0); > UChar32 zeroWidthSpaceCharacter = 0; > #endif >- auto* glyphPageCharacterZero = glyphPage(GlyphPage::pageNumberForCodePoint('0')); >- auto* glyphPageSpace = glyphPage(GlyphPage::pageNumberForCodePoint(space)); > > if (glyphPageZeroWidthSpace) > m_zeroWidthSpaceGlyph = glyphPageZeroWidthSpace->glyphDataForCharacter(zeroWidthSpaceCharacter).glyph; > >- // Nasty hack to determine if we should round or ceil space widths. >- // If the font is monospace or fake monospace we ceil to ensure that >- // every character and the space are the same width. Otherwise we round. >- if (glyphPageSpace) >- m_spaceGlyph = glyphPageSpace->glyphDataForCharacter(space).glyph; >- if (glyphPageCharacterZero) >- m_zeroGlyph = glyphPageCharacterZero->glyphDataForCharacter('0').glyph; >+ if (auto* page = glyphPage(GlyphPage::pageNumberForCodePoint(space))) >+ m_spaceGlyph = page->glyphDataForCharacter(space).glyph; > > // Force the glyph for ZERO WIDTH SPACE to have zero width, unless it is shared with SPACE. > // Helvetica is an example of a non-zero width ZERO WIDTH SPACE glyph. >@@ -159,14 +152,32 @@ void Font::platformGlyphInit() > if (m_zeroWidthSpaceGlyph == m_spaceGlyph) > m_zeroWidthSpaceGlyph = 0; > >- float width = widthForGlyph(m_spaceGlyph); >- m_spaceWidth = width; >- m_fontMetrics.setZeroWidth(widthForGlyph(m_zeroGlyph)); >+ // widthForGlyph depends on m_zeroWidthSpaceGlyph having the correct value. >+ // Therefore all calls to widthForGlyph must happen after this point. >+ >+ Glyph zeroGlyph = { 0 }; >+ if (auto* page = glyphPage(GlyphPage::pageNumberForCodePoint('0'))) >+ zeroGlyph = page->glyphDataForCharacter('0').glyph; >+ m_fontMetrics.setZeroWidth(widthForGlyph(zeroGlyph)); >+ >+ // Use the width of the CJK water ideogram (U+6C34) as the >+ // approximated width of ideograms in the font, as mentioned in >+ // https://www.w3.org/TR/css-values-4/#ic. This is currently only used >+ // to support the ic unit. >+ if (auto* page = glyphPage(GlyphPage::pageNumberForCodePoint(cjkWater))) { >+ auto glyph = page->glyphDataForCharacter(cjkWater).glyph; >+ m_fontMetrics.setIdeogramWidth(widthForGlyph(glyph)); >+ } >+ >+ m_spaceWidth = widthForGlyph(m_spaceGlyph); > auto amountToAdjustLineGap = std::min(m_fontMetrics.floatLineGap(), 0.0f); > m_fontMetrics.setLineGap(m_fontMetrics.floatLineGap() - amountToAdjustLineGap); > m_fontMetrics.setLineSpacing(m_fontMetrics.floatLineSpacing() - amountToAdjustLineGap); > determinePitch(); >- m_adjustedSpaceWidth = m_treatAsFixedPitch ? ceilf(width) : roundf(width); >+ // Nasty hack to determine if we should round or ceil space widths. >+ // If the font is monospace or fake monospace we ceil to ensure that >+ // every character and the space are the same width. Otherwise we round. >+ m_adjustedSpaceWidth = m_treatAsFixedPitch ? ceilf(m_spaceWidth) : roundf(m_spaceWidth); > } > > Font::~Font() >diff --git a/Source/WebCore/platform/graphics/Font.h b/Source/WebCore/platform/graphics/Font.h >index f866fdff91a6ff8b21627c6c18406869d8706525..a7ccac1207d499b579f57f6593be77cfb370b6e0 100644 >--- a/Source/WebCore/platform/graphics/Font.h >+++ b/Source/WebCore/platform/graphics/Font.h >@@ -135,7 +135,6 @@ public: > bool hasVerticalGlyphs() const { return m_hasVerticalGlyphs; } > bool isTextOrientationFallback() const { return m_isTextOrientationFallback; } > >- FontMetrics& fontMetrics() { return m_fontMetrics; } > const FontMetrics& fontMetrics() const { return m_fontMetrics; } > float sizePerUnit() const { return platformData().size() / (fontMetrics().unitsPerEm() ? fontMetrics().unitsPerEm() : 1); } > >@@ -153,22 +152,12 @@ public: > Path platformPathForGlyph(Glyph) const; > > float spaceWidth() const { return m_spaceWidth; } >- float adjustedSpaceWidth() const { return m_adjustedSpaceWidth; } >- void setSpaceWidths(float spaceWidth) >- { >- m_spaceWidth = spaceWidth; >- m_adjustedSpaceWidth = spaceWidth; >- } > > float syntheticBoldOffset() const { return m_syntheticBoldOffset; } > > Glyph spaceGlyph() const { return m_spaceGlyph; } >- void setSpaceGlyph(Glyph spaceGlyph) { m_spaceGlyph = spaceGlyph; } > Glyph zeroWidthSpaceGlyph() const { return m_zeroWidthSpaceGlyph; } >- void setZeroWidthSpaceGlyph(Glyph spaceGlyph) { m_zeroWidthSpaceGlyph = spaceGlyph; } > bool isZeroWidthSpaceGlyph(Glyph glyph) const { return glyph == m_zeroWidthSpaceGlyph && glyph; } >- Glyph zeroGlyph() const { return m_zeroGlyph; } >- void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; } > > GlyphData glyphDataForCharacter(UChar32) const; > Glyph glyphForCharacter(UChar32) const; >@@ -327,7 +316,6 @@ private: > #endif > > Glyph m_spaceGlyph { 0 }; >- Glyph m_zeroGlyph { 0 }; > Glyph m_zeroWidthSpaceGlyph { 0 }; > > Origin m_origin; // Whether or not we are custom font loaded via @font-face >diff --git a/Source/WebCore/platform/graphics/FontMetrics.h b/Source/WebCore/platform/graphics/FontMetrics.h >index e777a2b3dec06eeffd614e4b26b1694027a632ed..17fcba453427b9bd4850b8da766abda187f867bd 100644 >--- a/Source/WebCore/platform/graphics/FontMetrics.h >+++ b/Source/WebCore/platform/graphics/FontMetrics.h >@@ -122,6 +122,9 @@ public: > float zeroWidth() const { return m_zeroWidth; } > void setZeroWidth(float zeroWidth) { m_zeroWidth = zeroWidth; } > >+ std::optional<float> ideogramWidth() const { return m_ideogramWidth; } >+ void setIdeogramWidth(float ideogramWidth) { m_ideogramWidth = ideogramWidth; } >+ > float underlinePosition() const { return m_underlinePosition; } > void setUnderlinePosition(float underlinePosition) { m_underlinePosition = underlinePosition; } > >@@ -146,6 +149,7 @@ private: > m_intCapHeight = 0; > m_xHeight = 0; > m_zeroWidth = 0; >+ m_ideogramWidth = std::nullopt; > m_underlinePosition = 0; > m_underlineThickness = 0; > } >@@ -166,6 +170,7 @@ private: > int m_intCapHeight { 0 }; > > float m_zeroWidth { 0 }; >+ std::optional<float> m_ideogramWidth; > float m_xHeight { 0 }; > float m_underlinePosition { 0 }; > float m_underlineThickness { 0 }; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b2c86e831bca4485154713fdc9e55932288dc9ac..749dab16a698c0907f047258ce2d19681cc47086 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2021-09-23 Kiet Ho <tho22@apple.com> >+ >+ Implement the 'ic' unit from CSS Values 4 >+ https://bugs.webkit.org/show_bug.cgi?id=204276 >+ <rdar://problem/57256127> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestExpectations: remove ImageOnlyFailure expectations for ic-unit-* tests, now that they should pass. >+ * fast/css/CSSPrimitiveValue-ic-expected.txt: Added. >+ * fast/css/CSSPrimitiveValue-ic.html: Added. >+ > 2021-09-22 Andres Gonzalez <andresg_22@apple.com> > > Fix for LayoutTests/accessibility/heading-level.html in isolated tree mode. >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 18454eee8486a51756ad58cf3245867b730dc9be..4191a1e4211d3284f880c2f90965fcbd875af950 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,37 @@ >+2021-09-23 Kiet Ho <tho22@apple.com> >+ >+ Implement the 'ic' unit from CSS Values 4 >+ https://bugs.webkit.org/show_bug.cgi?id=204276 >+ <rdar://problem/57256127> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/css/css-values/ic-unit-001-expected.html: >+ * web-platform-tests/css/css-values/ic-unit-001.html: >+ * web-platform-tests/css/css-values/ic-unit-002-expected.html: >+ * web-platform-tests/css/css-values/ic-unit-002.html: >+ * web-platform-tests/css/css-values/ic-unit-003-expected.html: >+ * web-platform-tests/css/css-values/ic-unit-003.html: >+ * web-platform-tests/css/css-values/ic-unit-004-expected.html: >+ * web-platform-tests/css/css-values/ic-unit-004.html: >+ * web-platform-tests/css/css-values/ic-unit-008-expected.html: >+ * web-platform-tests/css/css-values/ic-unit-008.html: >+ * web-platform-tests/css/css-values/ic-unit-009-expected.html: >+ * web-platform-tests/css/css-values/ic-unit-009.html: >+ * web-platform-tests/css/css-values/ic-unit-010-expected.html: >+ * web-platform-tests/css/css-values/ic-unit-010.html: >+ * web-platform-tests/css/css-values/ic-unit-011-expected.html: >+ * web-platform-tests/css/css-values/ic-unit-011.html: >+ * web-platform-tests/css/css-values/ic-unit-012-expected.html: >+ * web-platform-tests/css/css-values/ic-unit-012.html: >+ * web-platform-tests/css/css-values/ic-unit-013-expected.html: Added. >+ * web-platform-tests/css/css-values/ic-unit-013.html: Added. >+ * web-platform-tests/css/css-values/ic-unit-014-expected.html: Added. >+ * web-platform-tests/css/css-values/ic-unit-014.html: Added. >+ * web-platform-tests/css/css-values/resources/IcTestFullWidth.woff2: Added. >+ * web-platform-tests/css/css-values/resources/IcTestHalfWidth.woff2: Added. >+ * web-platform-tests/css/css-values/resources/IcTestZeroWidth.woff2: Added. >+ > 2021-09-22 Myles C. Maxfield <mmaxfield@apple.com> > > [Cocoa] Hook up palettes to CoreText >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 9cbbf003a5d5fca3b4a1b19fc5b13fb36f534b58..a12cd96fca5a24839596edbf10134f66704564f4 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -3387,15 +3387,6 @@ webkit.org/b/203330 imported/w3c/web-platform-tests/css/css-values/attr-px-inval > webkit.org/b/203331 imported/w3c/web-platform-tests/css/css-values/attr-px-valid.html [ ImageOnlyFailure ] > webkit.org/b/203333 imported/w3c/web-platform-tests/css/css-values/ch-unit-003.html [ ImageOnlyFailure ] > webkit.org/b/203333 imported/w3c/web-platform-tests/css/css-values/ch-unit-010.html [ ImageOnlyFailure ] >-webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-001.html [ ImageOnlyFailure ] >-webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-002.html [ ImageOnlyFailure ] >-webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-003.html [ ImageOnlyFailure ] >-webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-004.html [ ImageOnlyFailure ] >-webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-008.html [ ImageOnlyFailure ] >-webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-009.html [ ImageOnlyFailure ] >-webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-010.html [ ImageOnlyFailure ] >-webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-011.html [ ImageOnlyFailure ] >-webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-012.html [ ImageOnlyFailure ] > webkit.org/b/203336 imported/w3c/web-platform-tests/css/css-values/lh-unit-001.html [ Pass ] > webkit.org/b/203336 imported/w3c/web-platform-tests/css/css-values/lh-unit-002.html [ Pass ] > webkit.org/b/203338 imported/w3c/web-platform-tests/css/css-values/vh_not_refreshing_on_chrome.html [ ImageOnlyFailure ] >diff --git a/LayoutTests/fast/css/CSSPrimitiveValue-ic-expected.txt b/LayoutTests/fast/css/CSSPrimitiveValue-ic-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..594aa40a6312b2afda54a680eaf7ce323f9463af >--- /dev/null >+++ b/LayoutTests/fast/css/CSSPrimitiveValue-ic-expected.txt >@@ -0,0 +1,15 @@ >+Testing behaviors of CSSPrimitiveValue on the ic unit. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS divWidth.primitiveType is CSSPrimitiveValue.CSS_UNKNOWN >+PASS divWidth.getFloatValue(CSSPrimitiveValue.CSS_S) threw exception InvalidAccessError: The object does not support the operation or argument.. >+PASS divWidth.getCounterValue() threw exception InvalidAccessError: The object does not support the operation or argument.. >+PASS divWidth.getRGBColorValue() threw exception InvalidAccessError: The object does not support the operation or argument.. >+PASS divWidth.getRectValue() threw exception InvalidAccessError: The object does not support the operation or argument.. >+PASS divWidth.getStringValue() threw exception InvalidAccessError: The object does not support the operation or argument.. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/css/CSSPrimitiveValue-ic.html b/LayoutTests/fast/css/CSSPrimitiveValue-ic.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6ea6c58f834ccfe73b9a313bdfa773bc56e9bf8b >--- /dev/null >+++ b/LayoutTests/fast/css/CSSPrimitiveValue-ic.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body> >+<div id="test-div" style="width: 1ic;"></div> >+<script> >+description("Testing behaviors of CSSPrimitiveValue on the ic unit."); >+ >+var divWidth = document.getElementById("test-div").style.getPropertyCSSValue("width"); >+ >+shouldBe("divWidth.primitiveType", "CSSPrimitiveValue.CSS_UNKNOWN"); >+ >+shouldThrowErrorName("divWidth.getFloatValue(CSSPrimitiveValue.CSS_S)", "InvalidAccessError"); >+shouldThrowErrorName("divWidth.getCounterValue()", "InvalidAccessError"); >+shouldThrowErrorName("divWidth.getRGBColorValue()", "InvalidAccessError"); >+shouldThrowErrorName("divWidth.getRectValue()", "InvalidAccessError"); >+shouldThrowErrorName("divWidth.getStringValue()", "InvalidAccessError"); >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-001-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-001-expected.html >index 2151f3b0c5dd883ffd2e04157726474eff0a5c2b..24711fefb4eaca85bcc9f456157574639dd4be2f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-001-expected.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-001-expected.html >@@ -3,9 +3,13 @@ > <title>CSS Values and Units Test Reference File</title> > <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/"> > <style> >-svg { width: 10ic; } >+.ref { >+ width: 200px; >+ height: 200px; >+ background: green; >+} > </style> > <body> > <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p> >- <svg viewBox="0 0 100 100"><rect x="0" y="0" width="100" height="100" fill="green"></svg> >+ <div class="ref"></div> > </body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-001.html >index b969278da90130eecf2c73c5accc945dda39d912..5045e0108e5edec8ca8ee6f09b07d52abc02e6b9 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-001.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-001.html >@@ -6,13 +6,20 @@ > <link rel="match" href="reference/ic-unit-001-ref.html"> > <meta name="assert" content="The ic unit is equal to the used advance measure of the æ°´ (CJK water ideograph, U+6C34) glyph found in the font used to render it."> > <style> >+@font-face { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+} >+ > span { >+ font: 20px IcTestFullWidth; > background: green; > color: green; > top: 0; bottom: 0; > position: absolute; > } > div { >+ font: 20px IcTestFullWidth; > background: red; > color: red; > position: relative; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-002-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-002-expected.html >index 962a748d2c059b45fca4d7788b04b77c61e0b923..24711fefb4eaca85bcc9f456157574639dd4be2f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-002-expected.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-002-expected.html >@@ -3,13 +3,13 @@ > <title>CSS Values and Units Test Reference File</title> > <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/"> > <style> >-svg { >- width: 10ic; >- writing-mode: vertical-rl; >- text-orientation: upright; >+.ref { >+ width: 200px; >+ height: 200px; >+ background: green; > } > </style> > <body> > <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p> >- <svg viewBox="0 0 100 100"><rect x="0" y="0" width="100" height="100" fill="green"></svg> >+ <div class="ref"></div> > </body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-002.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-002.html >index 0e4c73742f3a0d15e74cd1b82a1ff6d4b70ba28e..b514dba42ff3f7e660f43768050cb765f9dc5444 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-002.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-002.html >@@ -8,13 +8,21 @@ > <link rel="match" href="reference/ic-unit-002-ref.html"> > <meta name="assert" content="In vertical upright, the ic unit is equal to the used vertical advance measure of the æ°´ (CJK water ideograph, U+6C34) glyph found in the font used to render it."> > <style> >+@font-face { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+} >+ > span { >+ font: 20px IcTestFullWidth; > background: green; > color: green; > left: 0; right: 0; > position: absolute; > } >+ > div { >+ font: 20px IcTestFullWidth; > background: red; > color: red; > position: relative; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-003-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-003-expected.html >index 962a748d2c059b45fca4d7788b04b77c61e0b923..24711fefb4eaca85bcc9f456157574639dd4be2f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-003-expected.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-003-expected.html >@@ -3,13 +3,13 @@ > <title>CSS Values and Units Test Reference File</title> > <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/"> > <style> >-svg { >- width: 10ic; >- writing-mode: vertical-rl; >- text-orientation: upright; >+.ref { >+ width: 200px; >+ height: 200px; >+ background: green; > } > </style> > <body> > <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p> >- <svg viewBox="0 0 100 100"><rect x="0" y="0" width="100" height="100" fill="green"></svg> >+ <div class="ref"></div> > </body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-003.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-003.html >index 8e94b154ee4d3a889fdfce2c5ff1d78fac311295..3513d9c64645eba14dbc8cba64d42dd6c54175e9 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-003.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-003.html >@@ -8,13 +8,21 @@ > <link rel="match" href="reference/ic-unit-002-ref.html"> > <meta name="assert" content="In vertical mixed, the ic unit is equal to the used vertical advance measure of the æ°´ (CJK water ideograph, U+6C34) glyph found in the font used to render it."> > <style> >+@font-face { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+} >+ > span { >+ font: 20px IcTestFullWidth; > background: green; > color: green; > left: 0; right: 0; > position: absolute; > } >+ > div { >+ font: 20px IcTestFullWidth; > background: red; > color: red; > position: relative; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-004-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-004-expected.html >index 2151f3b0c5dd883ffd2e04157726474eff0a5c2b..24711fefb4eaca85bcc9f456157574639dd4be2f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-004-expected.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-004-expected.html >@@ -3,9 +3,13 @@ > <title>CSS Values and Units Test Reference File</title> > <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/"> > <style> >-svg { width: 10ic; } >+.ref { >+ width: 200px; >+ height: 200px; >+ background: green; >+} > </style> > <body> > <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p> >- <svg viewBox="0 0 100 100"><rect x="0" y="0" width="100" height="100" fill="green"></svg> >+ <div class="ref"></div> > </body> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-004.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-004.html >index 257a243359ad1604567bf10c52662c1fe12de6bf..64755c385c2b88b80eb79dd575f8b050ed2bc5c1 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-004.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-004.html >@@ -8,13 +8,21 @@ > <link rel="match" href="reference/ic-unit-001-ref.html"> > <meta name="assert" content="In vertical sideways, the ic unit is equal to the used horizontal advance measure of the æ°´ (CJK water ideograph, U+6C34) glyph found in the font used to render it."> > <style> >+@font-face { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+} >+ > span { >+ font: 20px IcTestFullWidth; > background: green; > color: green; > left: 0; right: 0; > position: absolute; > } >+ > div { >+ font: 20px IcTestFullWidth; > background: red; > color: red; > position: relative; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-008-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-008-expected.html >index 6a27f6e820d565de02f998da3aa7e5e22129e2fb..2b6d018fb5fdea816582153a9dcdc2a285d7bde1 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-008-expected.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-008-expected.html >@@ -7,9 +7,16 @@ > <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > line-height: 1.8; /* arbitrary line-height */ > } >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-008.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-008.html >index 05ab218069871eb9d7d3df5e5d09be4f5dcc328a..9003c5fd5a18c54743d9c711447a6121225d1cf8 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-008.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-008.html >@@ -12,9 +12,16 @@ > <meta name="assert" content="In this test, the ic unit is the advance width measure of the æ°´ (CJK water ideograph, U+6C34) glyph."> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > } > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-009-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-009-expected.html >index 2ae37b8b619bf9adea6c4f39ae87836c551bfc37..124a9b8ce406e9a9f7be1f292152dac21b19bbed 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-009-expected.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-009-expected.html >@@ -7,9 +7,16 @@ > <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > line-height: 1.8; /* arbitrary line-height */ > writing-mode: vertical-rl; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-009.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-009.html >index 11ec5985c0288cef75d02869124eddfe131251fd..901f1c97404fc2bfa239e684b6a7925bfe499cf4 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-009.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-009.html >@@ -12,9 +12,16 @@ > <meta name="assert" content="In this test, the ic unit is the advance height measure of the æ°´ (CJK water ideograph, U+6C34) glyph."> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > writing-mode: vertical-rl; > } >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-010-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-010-expected.html >index 2ae37b8b619bf9adea6c4f39ae87836c551bfc37..124a9b8ce406e9a9f7be1f292152dac21b19bbed 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-010-expected.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-010-expected.html >@@ -7,9 +7,16 @@ > <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > line-height: 1.8; /* arbitrary line-height */ > writing-mode: vertical-rl; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-010.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-010.html >index ca963041a32b30c0aaa552e8093db32c7443b9c4..e06646571438e8583a4531845042710dd705bebd 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-010.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-010.html >@@ -12,9 +12,16 @@ > <meta name="assert" content="In this test, the ic unit is the advance height measure of the æ°´ (CJK water ideograph, U+6C34) glyph."> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > text-orientation: mixed; > writing-mode: vertical-rl; >@@ -47,4 +54,4 @@ > > æ°´ (CJK water ideograph, U+6C34) glyph == 水 > >- --> >\ No newline at end of file >+ --> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-011-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-011-expected.html >index 2ae37b8b619bf9adea6c4f39ae87836c551bfc37..124a9b8ce406e9a9f7be1f292152dac21b19bbed 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-011-expected.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-011-expected.html >@@ -7,9 +7,16 @@ > <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > line-height: 1.8; /* arbitrary line-height */ > writing-mode: vertical-rl; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-011.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-011.html >index 584002247196c8b2af5becf89d9694379b1e0350..edeaee6219d1d8be7c807257d6b3fa9ee12b8c0e 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-011.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-011.html >@@ -12,9 +12,16 @@ > <meta name="assert" content="In this test, the ic unit is the advance height measure of the æ°´ (CJK water ideograph, U+6C34) glyph."> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > text-orientation: upright; > writing-mode: vertical-rl; >@@ -47,4 +54,4 @@ > > æ°´ (CJK water ideograph, U+6C34) glyph == 水 > >- --> >\ No newline at end of file >+ --> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-012-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-012-expected.html >index 2ae37b8b619bf9adea6c4f39ae87836c551bfc37..124a9b8ce406e9a9f7be1f292152dac21b19bbed 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-012-expected.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-012-expected.html >@@ -7,9 +7,16 @@ > <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > line-height: 1.8; /* arbitrary line-height */ > writing-mode: vertical-rl; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-012.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-012.html >index ac281ccd4afb7ed68e67d286659ec89d3b8c4f23..badb199ad2255f13f88ed89dd8ada58110f8d98b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-012.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-012.html >@@ -12,9 +12,16 @@ > <meta name="assert" content="In this test, the ic unit is the advance width measure of the æ°´ (CJK water ideograph, U+6C34) glyph."> > > <style> >+ @font-face >+ { >+ font-family: IcTestFullWidth; >+ src: url(resources/IcTestFullWidth.woff2); >+ } >+ > div > { > float: left; >+ font-family: IcTestFullWidth; > font-size: 80px; /* arbitrary font size */ > text-orientation: sideways; > writing-mode: vertical-rl; >@@ -47,4 +54,4 @@ > > æ°´ (CJK water ideograph, U+6C34) glyph == 水 > >- --> >\ No newline at end of file >+ --> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-013-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-013-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..67e75b953f57bfb8e4cf0c937f0779e6485f3007 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-013-expected.html >@@ -0,0 +1,19 @@ >+<!DOCTYPE html> >+ >+<meta charset="utf-8"> >+<title>CSS Values and Units Test: support for the ic unit</title> >+<style> >+.test, .ref { >+ width: 100px; >+ height: 20px; >+ background: green; >+} >+ >+.test { >+ margin-bottom: 10px; >+} >+</style> >+ >+<p>The test passes if there are two green rectangles of equal length.</p> >+<div class="test"></div> >+<div class="ref"></div> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-013.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-013.html >new file mode 100644 >index 0000000000000000000000000000000000000000..84af3797c413401db8a654fc5c2221cf3ba28b9c >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-013.html >@@ -0,0 +1,34 @@ >+<!DOCTYPE html> >+ >+<meta charset="utf-8"> >+<title>CSS Values and Units Test: support for the ic unit</title> >+<link rel="author" title="Kiet Ho" href="mailto:tho22@apple.com"> >+<link rel="help" href="https://www.w3.org/TR/css-values-4/#ic"> >+<link rel="match" href="ic-unit-013-expected.html"> >+<meta name="assert" content="The ic unit is equal to 0em if the CJK water glyph's advance is 0."> >+<style> >+/* The following font contains the CJK water (U+6C34) glyph as a zero-width character. */ >+@font-face { >+ font-family: IcTestZeroWidth; >+ src: url(resources/IcTestZeroWidth.woff2); >+} >+ >+.test { >+ font: 20px IcTestZeroWidth; >+ width: calc(100px + 10ic); >+ height: 20px; >+ background: green; >+ margin-bottom: 10px; >+} >+ >+.ref { >+ /* Each ic should be equal to 0px because the CJK water glyph in the font is zero-width. */ >+ width: 100px; >+ height: 20px; >+ background: green; >+} >+</style> >+ >+<p>The test passes if there are two green rectangles of equal length.</p> >+<div class="test"></div> >+<div class="ref"></div> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-014-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-014-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2e5c9b43b4d152dc5d6bb4b4add70db17a67dc9c >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-014-expected.html >@@ -0,0 +1,19 @@ >+<!DOCTYPE html> >+ >+<meta charset="utf-8"> >+<title>CSS Values and Units Test: support for the ic unit</title> >+<style> >+.test, .ref { >+ width: 200px; >+ height: 20px; >+ background: green; >+} >+ >+.test { >+ margin-bottom: 10px; >+} >+</style> >+ >+<p>The test passes if there are two green rectangles of equal length.</p> >+<div class="test"></div> >+<div class="ref"></div> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-014.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-014.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0aa62e7f683da5c0e65511ab84c833412b7f8815 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ic-unit-014.html >@@ -0,0 +1,41 @@ >+<!DOCTYPE html> >+ >+<meta charset="utf-8"> >+<title>CSS Values and Units Test: support for the ic unit</title> >+<link rel="author" title="Kiet Ho" href="mailto:tho22@apple.com"> >+<link rel="help" href="https://www.w3.org/TR/css-values-4/#ic"> >+<link rel="match" href="ic-unit-014-expected.html"> >+<meta name="assert" content="The ic unit is equal to 0.5em if the CJK water glyph's advance is 0.5em."> >+<style> >+/* The following font contains the CJK water (U+6C34) glyph as a rectangle box, >+ with the width being exactly half of its height. */ >+@font-face { >+ font-family: IcTestHalfWidth; >+ src: url(resources/IcTestHalfWidth.woff2); >+} >+ >+.test { >+ font-family: IcTestHalfWidth; >+ font-size: 20px; >+ width: calc(100px + 10ic); >+ height: 20px; >+ background: green; >+ margin-bottom: 10px; >+} >+ >+.ref { >+ /* >+ Each ic is equal to 10px, the width of a CJK water glyph. >+ (its height is 20px, and its width is half the height). >+ The width of .test is then: >+ 100px + (10ic * 10px / ic) = 200px >+ */ >+ width: 200px; >+ height: 20px; >+ background: green; >+} >+</style> >+ >+<p>The test passes if there are two green rectangles of equal length.</p> >+<div class="test"></div> >+<div class="ref"></div> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/resources/IcTestFullWidth.woff2 b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/resources/IcTestFullWidth.woff2 >new file mode 100644 >index 0000000000000000000000000000000000000000..a4ebf4fc09936b424f19e9d98a97924e36da06a1 >GIT binary patch >literal 612 >zcmXT-cQayOWB>xD6b3#J&87fk3qZs`d{kiX<`&{BBPGL@z|iEx!6L}PRZz>##lUFB >zq{1w~qQKfBz-}b1$I8%mXj^6R6Xnj7(@JfrUG43^KhCSZ|5s9?^<u=<$fcsb>~`K# >z8L9<Mx$+sVn?L=&_Ql_fuXV2Y+}p|<7&rN-ehKCB2xVMt<)C@~`Ce1o2DJ~2HPa8= >zYgo6dP;Qw(;(<VYt`AH{9W*{)%XeF{&T3o7kxXZfAD=$&VlB9`x2}2d-Q}?Y3vO@F >z5NdRox?^=~&5Zel?D8i2B0KqlyxAGvGFTKU+aJEzwl%SH>i=bNc1(;7oGom;ZUPa? >zEN(8o4M9z_S0`rtFOvJitq{fOpd!Q|Fw55OY3`B#0ZmMAGcNSjF|<|+3WQ$0dMWsM >zlJ4B+uJL}huj;=fe@g$TeE+`jTAqgKDT!~lt^H$=7Zts4-CeVn?TykKk3^{)+<I*O >zp~t6M9^AcJm^dTq_gy*d<8Qr}ES!15J!87U3HKdA3uZbnG-xeraQZ0McuCJuiDjDy >z!`^v{3`-amo;P7yc~+09S5llK;MX6g2C=_}oerz_S+FXuVwO<u5%ky_cEMtKm(eqM >zU9}eNZBpH-4|c4awX>F;i!b-ag)Ldn4sglrUzKwu%YLzf4D<3cx;ww#ko)5j#>BoY >z*YZIAru57{Nflo10-e*ZrG2>ei?f}5t*}l-{jKiv9FJb+bDn3_4u{k{)tXmf|0U+$ >w=6uutlQK=LI<t8XM{8xw(lebu{csEi=b!z@xj3>kSc(-ly}fpA)nrp$0AR!TBLDyZ > >literal 0 >HcmV?d00001 > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/resources/IcTestHalfWidth.woff2 b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/resources/IcTestHalfWidth.woff2 >new file mode 100644 >index 0000000000000000000000000000000000000000..a545d2c730083b428605ba7bf2ced92b9b7e30e4 >GIT binary patch >literal 612 >zcmXT-cQayOWB>xD6b3#J&87fk^FqWxd{kiX<`&{BBPGL@z|iEx!6L}PRZzpt#lUFB >zq{1w~qQKh1%WfpC#mX?RxzIWOR8UlhkXNkU`=k8bUq62Mdt-a?`|5brcU8tVv(z`b >zY~JFmTq3pKs739XQI3X~=d15)-=2>=`T4{hxwNxOW_l=v8gY8vlbEQt<SOelhRNsc >z-miVhXwu04V0XzraX0e|Ha?2-tYytTRe=rSj7#r12^p5Y|D`Mx?8NayF`DuB*XJAV >z?|JIju+NgW(_z7~hzlpnH9v}}_d2I9cFrnc$Y6eO@AMCb?|X~6`>VeFkL-QK%))R@ >zfQxIIfQ7$k#G**%P|-JYfB)D2Ulhe~QH5cm2ZO^4z8w?u9sc~+cVx{K`C`ZvGG{@< >ziml(Intv@>US7S{vH0=fABR8glJPYBaI=<SAG_bY`t2si*M$fFulyG)a$IlEDUoas >z=KLe`k3Bxu^5E}#=39$TtS?({mHRkHp!*SXE+^C6>RI2T6&M_R%^F-j$t+wq$w!Gr >zPne-?p8|uXgTzf2g{?8p3vPU32vK&=kT~wOCsU++<)X5NmJLp>QdZrMChDvb72?gd >z6E<6W#PdPlzNUqHo2RU6ow#XbV>9QSO1GRVQ=FU?dYJindS!J>-ab&?B(Nhh_o+ht >z$#XXZiUnmNIDT&`TRLCUf=k@}8B3b#&J1(8P2Lt3M+7x<-<dZ*GrjXM?ZxD(^n9tB >v6EZS$TJBgG>{-m!eppjxYkXO;vdV|}Jb?u(I8Ha7xb`|cIR468P|^YbBHs9X > >literal 0 >HcmV?d00001 > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-values/resources/IcTestZeroWidth.woff2 b/LayoutTests/imported/w3c/web-platform-tests/css/css-values/resources/IcTestZeroWidth.woff2 >new file mode 100644 >index 0000000000000000000000000000000000000000..4c90173a93f22efd31a8825a6240b27707e300c6 >GIT binary patch >literal 616 >zcmV-u0+;=FPew8T0RR9100L+L4gdfE00tlc00I*L0RR9100000000000000000000 >z0000#Mn+Uk92y)3U;u(b2m}!b3UGc43IG8%0we<v1Rw>34F@tCECmr&o5=vaIIx?2 >z=HViMdv!!@UMy-U4KuMQj^=lN7!UvLm)<usyPU90nf~@v0V@VYD!QZq9jeM&0wcFV >z;qh%;>jI10#<5ag5+Pa@ZFW;2^bFMIOz}hUIaL^2U1$H#0Pin1-DgKP<F+PnOo>de >zx#$DV!xZu;fvM4$fQx_v@g@>PUcKo>B(4!5;Cnv<KhM88{JeOpBLH3F3K9Z=693|< >z8tG-~<4IX){LzaRNi74=1i+E2`!2gZxs#iFb8{hAAONsXAR}W!fUUB?gkm9zBADDf >zSNfOpVgW>*07OCp00c3~#py9(E(jFRL`D}QfP(cBh*C<YHc(D=YVCHTb7S%A;n!1( >z`n2yA)uHHB;8WPJ^>d?`sy@|gKem3($yDW29>Qw^VAW$f6LH5tu;szG-wbX2-|Q6U >zt>zq}$`zUt2z1s32zE|m0sv6rn#B+&VU9qVWvvMzu+w_Lp!Whm5+Dp&B0$oxM}Ta# >zR{|76{t8et9P<UJ8;ZlSC@r85VZIE>pdMr=?1y5$KGZBUJwV<3*Z^ebG9n(Y9T7PT >z;r8O7yEKyL-AQyVgw+5&g868N2)-iA0@NJqZGTC`5Lh$FBU=iW9_iLx!ztlgiCq*K >z!EN-kB2k;1ym=AlyBQT`uFgYnEDR`y^d(+W2+G8QWky8;@Bh_68IX`Afyz%&{aFB^ >C8~Z>2 > >literal 0 >HcmV?d00001 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 204276
:
437711
|
437712
|
437717
|
437725
|
437944
|
437950
|
439023
|
439032
|
439128
|
439579