WebKit Bugzilla
Attachment 349247 Details for
Bug 46987
: Font sizes are rounded to the nearest 1px
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
bug-46987-20180907224702.patch (text/plain), 40.06 KB, created by
Myles C. Maxfield
on 2018-09-07 22:47:03 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2018-09-07 22:47:03 PDT
Size:
40.06 KB
patch
obsolete
>Subversion Revision: 235819 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e04317f91822177b8e922410d72145d4fbf94993..e7bb8772beecd218856138960b60cb7ca3b1262b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,89 @@ >+2018-09-07 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ Fractional font sizes are improperly handled >+ https://bugs.webkit.org/show_bug.cgi?id=46987 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * css/StyleResolver.cpp: >+ (WebCore::StyleResolver::adjustRenderStyle): >+ * editing/TextIterator.cpp: >+ (WebCore::shouldEmitExtraNewlineForNode): >+ * html/canvas/CanvasRenderingContext2D.cpp: >+ (WebCore::CanvasRenderingContext2D::font const): >+ * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: >+ (WebCore::Layout::SimpleLineBreaker::adjustSplitPositionWithHyphenation const): >+ * loader/cache/CachedSVGFont.cpp: >+ (WebCore::CachedSVGFont::platformDataFromCustomData): >+ * page/PrintContext.cpp: >+ (WebCore::PrintContext::pageProperty): >+ * page/ios/FrameIOS.mm: >+ (WebCore::Frame::renderRectForPoint const): >+ * platform/graphics/FontCache.h: >+ (WebCore::FontDescriptionKey::FontDescriptionKey): >+ * platform/graphics/FontCascade.h: >+ (WebCore::FontCascade::pixelSize const): Deleted. >+ * platform/graphics/FontDescription.h: >+ (WebCore::FontDescription::computedSize const): >+ (WebCore::FontDescription::computedPixelSize const): Deleted. >+ * platform/graphics/cocoa/FontCacheCoreText.cpp: >+ (WebCore::FontCache::createFontPlatformData): >+ (WebCore::FontCache::lastResortFallbackFont): >+ * platform/graphics/mac/FontCustomPlatformData.cpp: >+ (WebCore::FontCustomPlatformData::fontPlatformData): >+ * platform/mac/ThemeMac.mm: >+ (WebCore::controlSizeForFont): >+ (WebCore::stepperControlSizeForFont): >+ * rendering/RenderBlockFlow.cpp: >+ (WebCore::RenderBlockFlow::columnGap const): >+ * rendering/RenderMultiColumnSet.cpp: >+ (WebCore::RenderMultiColumnSet::columnGap const): >+ * rendering/RenderRubyRun.cpp: >+ (WebCore::shouldOverhang): >+ (WebCore::RenderRubyRun::getOverhang const): >+ * rendering/RenderRubyText.cpp: >+ (WebCore::RenderRubyText::adjustInlineDirectionLineBounds const): >+ * rendering/RenderText.cpp: >+ (WebCore::maxWordFragmentWidth): >+ * rendering/RenderThemeIOS.mm: >+ (WebCore::RenderThemeIOS::adjustCheckboxStyle const): >+ (WebCore::RenderThemeIOS::adjustRadioStyle const): >+ * rendering/RenderThemeMac.mm: >+ (WebCore::RenderThemeMac::controlSizeForFont const): >+ (WebCore::RenderThemeMac::controlSizeForSystemFont const): >+ (WebCore::RenderThemeMac::paintMenuListButtonDecorations): >+ (WebCore::RenderThemeMac::popupInternalPaddingBox const): >+ (WebCore::RenderThemeMac::adjustMenuListButtonStyle const): >+ * rendering/RootInlineBox.cpp: >+ (WebCore::RootInlineBox::verticalPositionForBox): >+ * rendering/SimpleLineLayout.cpp: >+ (WebCore::SimpleLineLayout::hyphenPositionForFragment): >+ * rendering/TextDecorationPainter.cpp: >+ (WebCore::TextDecorationPainter::paintTextDecoration): >+ * rendering/line/BreakingContext.h: >+ (WebCore::tryHyphenating): >+ * rendering/mathml/RenderMathMLRow.cpp: >+ (WebCore::RenderMathMLRow::stretchVerticalOperatorsAndLayoutChildren): >+ * rendering/style/RenderStyle.cpp: >+ (WebCore::RenderStyle::computedLineHeight const): >+ (WebCore::RenderStyle::computedFontPixelSize const): Deleted. >+ * rendering/style/RenderStyle.h: >+ * rendering/svg/SVGInlineTextBox.cpp: >+ (WebCore::textShouldBePainted): >+ * rendering/svg/SVGTextLayoutEngineBaseline.cpp: >+ (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const): >+ * rendering/svg/SVGTextLayoutEngineSpacing.cpp: >+ (WebCore::SVGTextLayoutEngineSpacing::calculateCSSKerningAndSpacing): >+ * style/InlineTextBoxStyle.cpp: >+ (WebCore::visualOverflowForDecorations): >+ * style/StyleTreeResolver.cpp: >+ (WebCore::Style::TreeResolver::resolveElement): >+ * svg/SVGLengthContext.cpp: >+ (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS const): >+ (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits const): >+ > 2018-09-07 Youenn Fablet <youenn@apple.com> > > RTCRtpReceiver::track should return a MediaStreamTrack reference >diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp >index 2dc57382fba99f2424b86efcf082f60b4bb5b1c5..06815a1b40a8475fa3be1991dae4998036f2acd4 100644 >--- a/Source/WebCore/css/StyleResolver.cpp >+++ b/Source/WebCore/css/StyleResolver.cpp >@@ -1049,7 +1049,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& par > > // Important: Intrinsic margins get added to controls before the theme has adjusted the style, since the theme will > // alter fonts and heights/widths. >- if (is<HTMLFormControlElement>(element) && style.computedFontPixelSize() >= 11) { >+ if (is<HTMLFormControlElement>(element) && style.computedFontSize() >= 11) { > // Don't apply intrinsic margins to image buttons. The designer knows how big the images are, > // so we have to treat all image buttons as though they were explicitly sized. > if (!is<HTMLInputElement>(*element) || !downcast<HTMLInputElement>(*element).isImageButton()) >diff --git a/Source/WebCore/editing/TextIterator.cpp b/Source/WebCore/editing/TextIterator.cpp >index b28d846f687628c3c030f4729c6ac25102552227..ba5911cc56bfac0c7983dcd17ada9a995776e4f1 100644 >--- a/Source/WebCore/editing/TextIterator.cpp >+++ b/Source/WebCore/editing/TextIterator.cpp >@@ -1045,9 +1045,9 @@ static bool shouldEmitExtraNewlineForNode(Node& node) > if (!renderBox.height()) > return false; > >- int bottomMargin = renderBox.collapsedMarginAfter(); >- int fontSize = renderBox.style().fontDescription().computedPixelSize(); >- return bottomMargin * 2 >= fontSize; >+ auto bottomMargin = renderBox.collapsedMarginAfter(); >+ auto fontSize = renderBox.style().fontDescription().computedSize(); >+ return static_cast<float>(bottomMargin) * 2 >= fontSize; > } > > static int collapsedSpaceLength(RenderText& renderer, int textEnd) >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >index e27d95194819b02e9414d49bfa8faff2ea1761de..219883d2b01d42e1e1036f74ca47f62741dc2f06 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >@@ -100,7 +100,7 @@ String CanvasRenderingContext2D::font() const > if (fontDescription.variantCaps() == FontVariantCaps::Small) > serializedFont.appendLiteral("small-caps "); > >- serializedFont.appendNumber(fontDescription.computedPixelSize()); >+ serializedFont.appendNumber(fontDescription.computedSize()); > serializedFont.appendLiteral("px"); > > for (unsigned i = 0; i < fontDescription.familyCount(); ++i) { >diff --git a/Source/WebCore/layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp b/Source/WebCore/layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp >index a2a74e77406f33d740959f761d1e0a51959b3abb..319f83507b82ecceac32dfec856160a61d93dba2 100644 >--- a/Source/WebCore/layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp >+++ b/Source/WebCore/layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp >@@ -564,7 +564,7 @@ std::optional<ContentPosition> SimpleLineBreaker::adjustSplitPositionWithHyphena > if (m_currentLine.hasContent()) > adjustedAvailableWidth += m_style.font.spaceWidth(); > >- if (!enoughWidthForHyphenation(adjustedAvailableWidth, m_style.font.pixelSize())) >+ if (!enoughWidthForHyphenation(adjustedAvailableWidth, m_style.font.size())) > return { }; > > // Find the split position where hyphen surely fits (we might be able to fit the hyphen at the split position). >diff --git a/Source/WebCore/loader/cache/CachedSVGFont.cpp b/Source/WebCore/loader/cache/CachedSVGFont.cpp >index 4cb28ccaa1b084ee4f05ef14d3f84386bff15224..02c85ea94784e4e6819ee3a320625c6f1230aa88 100644 >--- a/Source/WebCore/loader/cache/CachedSVGFont.cpp >+++ b/Source/WebCore/loader/cache/CachedSVGFont.cpp >@@ -61,7 +61,7 @@ RefPtr<Font> CachedSVGFont::createFont(const FontDescription& fontDescription, c > FontPlatformData CachedSVGFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities) > { > if (m_externalSVGDocument) >- return FontPlatformData(fontDescription.computedPixelSize(), bold, italic); >+ return FontPlatformData(fontDescription.computedSize(), bold, italic); > return CachedFont::platformDataFromCustomData(fontDescription, bold, italic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities); > } > >diff --git a/Source/WebCore/page/PrintContext.cpp b/Source/WebCore/page/PrintContext.cpp >index c6b03517595fb6357285e9d7784eb84167be2938..6b34412930d58a1a3c7fc45a23ab17d832de289a 100644 >--- a/Source/WebCore/page/PrintContext.cpp >+++ b/Source/WebCore/page/PrintContext.cpp >@@ -303,7 +303,7 @@ String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pa > if (!strcmp(propertyName, "line-height")) > return String::number(style->lineHeight().value()); > if (!strcmp(propertyName, "font-size")) >- return String::number(style->fontDescription().computedPixelSize()); >+ return String::number(style->fontDescription().computedSize()); > if (!strcmp(propertyName, "font-family")) > return style->fontDescription().firstFamily(); > if (!strcmp(propertyName, "size")) >diff --git a/Source/WebCore/page/ios/FrameIOS.mm b/Source/WebCore/page/ios/FrameIOS.mm >index aacad2852befe9104080e30d6e75cddad2189b7b..6de466e188c0636ad4d6ef3038409361109f2fdb 100644 >--- a/Source/WebCore/page/ios/FrameIOS.mm >+++ b/Source/WebCore/page/ios/FrameIOS.mm >@@ -206,7 +206,7 @@ CGRect Frame::renderRectForPoint(CGPoint point, bool* isReplaced, float* fontSiz > #if CHECK_FONT_SIZE > for (RenderObject* textRenderer = hitRenderer; textRenderer; textRenderer = textRenderer->traverseNext(hitRenderer)) { > if (textRenderer->isText()) { >- *fontSize = textRenderer->font(true).pixelSize(); >+ *fontSize = textRenderer->font(true).size(); > break; > } > } >diff --git a/Source/WebCore/platform/graphics/FontCache.h b/Source/WebCore/platform/graphics/FontCache.h >index 8564db9c1e0f25e08467f48a840a2ea1b18cc1ca..20b25878e7a62e5b7e312d9e0ff46f5fc581fbc3 100644 >--- a/Source/WebCore/platform/graphics/FontCache.h >+++ b/Source/WebCore/platform/graphics/FontCache.h >@@ -71,7 +71,7 @@ struct FontDescriptionKey { > FontDescriptionKey() = default; > > FontDescriptionKey(const FontDescription& description) >- : m_size(description.computedPixelSize()) >+ : m_size(description.computedSize()) > , m_fontSelectionRequest(description.fontSelectionRequest()) > , m_flags(makeFlagsKey(description)) > , m_locale(description.locale()) >@@ -155,7 +155,7 @@ private: > static const unsigned cHashTableDeletedSize = 0xFFFFFFFFU; > > // FontCascade::locale() is explicitly not included in this struct. >- unsigned m_size { 0 }; >+ float m_size { 0 }; > FontSelectionRequest m_fontSelectionRequest; > std::array<unsigned, 2> m_flags {{ 0, 0 }}; > AtomicString m_locale; >diff --git a/Source/WebCore/platform/graphics/FontCascade.h b/Source/WebCore/platform/graphics/FontCascade.h >index eaa08e012fa86e2b34f37aeb62b27260ec37de8c..1d30b5c866fbc4501a4e3d7a2d9d3cb5d319e913 100644 >--- a/Source/WebCore/platform/graphics/FontCascade.h >+++ b/Source/WebCore/platform/graphics/FontCascade.h >@@ -113,7 +113,6 @@ public: > > const FontCascadeDescription& fontDescription() const { return m_fontDescription; } > >- int pixelSize() const { return fontDescription().computedPixelSize(); } > float size() const { return fontDescription().computedSize(); } > > WEBCORE_EXPORT void update(RefPtr<FontSelector>&& = nullptr) const; >diff --git a/Source/WebCore/platform/graphics/FontDescription.h b/Source/WebCore/platform/graphics/FontDescription.h >index 13fcdb3cf5c3fe35190ec3c1204d63f8ad4420c3..e4de1fea2e321dcc027f9b83377bfaf4a948f73f 100644 >--- a/Source/WebCore/platform/graphics/FontDescription.h >+++ b/Source/WebCore/platform/graphics/FontDescription.h >@@ -63,7 +63,6 @@ public: > bool operator!=(const FontDescription& other) const { return !(*this == other); } > > float computedSize() const { return m_computedSize; } >- unsigned computedPixelSize() const { return unsigned(m_computedSize + 0.5f); } > std::optional<FontSelectionValue> italic() const { return m_fontSelectionRequest.slope; } > FontSelectionValue stretch() const { return m_fontSelectionRequest.width; } > FontSelectionValue weight() const { return m_fontSelectionRequest.weight; } >diff --git a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >index c48102036cb78ba6c59d019101f96c23449e47e0..5cf036e59f447aa8aa11a2e5ba509d13141e15fb 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >+++ b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >@@ -1241,7 +1241,7 @@ static void autoActivateFont(const String& name, CGFloat size) > > std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities) > { >- float size = fontDescription.computedPixelSize(); >+ auto size = fontDescription.computedSize(); > > auto font = fontWithFamily(family, fontDescription, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, size); > >@@ -1487,15 +1487,15 @@ Ref<Font> FontCache::lastResortFallbackFont(const FontDescription& fontDescripti > // LastResort is guaranteed to be non-null. > #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) > auto fontDescriptor = adoptCF(CTFontDescriptorCreateLastResort()); >- auto font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), fontDescription.computedPixelSize(), nullptr)); >+ auto font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), fontDescription.computedSize(), nullptr)); > #else > // Even if Helvetica doesn't exist, CTFontCreateWithName will return > // a thin wrapper around a GraphicsFont which represents LastResort. >- auto font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), fontDescription.computedPixelSize(), nullptr)); >+ auto font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), fontDescription.computedSize(), nullptr)); > #endif > bool syntheticBold, syntheticOblique; > std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair(); >- FontPlatformData platformData(font.get(), fontDescription.computedPixelSize(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode()); >+ FontPlatformData platformData(font.get(), fontDescription.computedSize(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode()); > return fontForPlatformData(platformData); > } > >diff --git a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp b/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp >index 749a585057434fa3cff4bddd5617622339f87f1a..d69d39c755a6be8e67e1a9f2c1502d76997844ab 100644 >--- a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp >+++ b/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp >@@ -42,7 +42,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& > auto modifiedFontDescriptor = adoptCF(CTFontDescriptorCreateCopyWithAttributes(m_fontDescriptor.get(), attributes.get())); > ASSERT(modifiedFontDescriptor); > >- int size = fontDescription.computedPixelSize(); >+ auto size = fontDescription.computedSize(); > FontOrientation orientation = fontDescription.orientation(); > FontWidthVariant widthVariant = fontDescription.widthVariant(); > RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(modifiedFontDescriptor.get(), size, nullptr)); >diff --git a/Source/WebCore/platform/mac/ThemeMac.mm b/Source/WebCore/platform/mac/ThemeMac.mm >index 957f7c50728841d4d0501bbcb2116ec6d166da50..e092654f604d7e15d854a3594f15610825cf68c7 100644 >--- a/Source/WebCore/platform/mac/ThemeMac.mm >+++ b/Source/WebCore/platform/mac/ThemeMac.mm >@@ -134,7 +134,7 @@ Theme& Theme::singleton() > > static NSControlSize controlSizeForFont(const FontCascade& font) > { >- int fontSize = font.pixelSize(); >+ auto fontSize = font.size(); > if (fontSize >= 16) > return NSControlSizeRegular; > if (fontSize >= 11) >@@ -600,7 +600,7 @@ static const std::array<IntSize, 3>& stepperSizes() > // should be equal to or less than the corresponding text field height, > static NSControlSize stepperControlSizeForFont(const FontCascade& font) > { >- int fontSize = font.pixelSize(); >+ auto fontSize = font.size(); > if (fontSize >= 18) > return NSControlSizeRegular; > if (fontSize >= 13) >diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp >index 1941427613e23c1e1541433632e7aeb431fb3c54..975e5fed54d3450346da4bea615a8c4bd0afe641 100644 >--- a/Source/WebCore/rendering/RenderBlockFlow.cpp >+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp >@@ -369,7 +369,7 @@ bool RenderBlockFlow::recomputeLogicalWidthAndColumnWidth() > LayoutUnit RenderBlockFlow::columnGap() const > { > if (style().columnGap().isNormal()) >- return style().fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins. >+ return style().fontDescription().computedSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins. > return valueForLength(style().columnGap().length(), availableLogicalWidth()); > } > >diff --git a/Source/WebCore/rendering/RenderMultiColumnSet.cpp b/Source/WebCore/rendering/RenderMultiColumnSet.cpp >index 751e810615a0e4fd5992d477e64c2308a3159181..146f64091a0b9a2d9f678778ab4f7a1ddd026a85 100644 >--- a/Source/WebCore/rendering/RenderMultiColumnSet.cpp >+++ b/Source/WebCore/rendering/RenderMultiColumnSet.cpp >@@ -430,7 +430,7 @@ LayoutUnit RenderMultiColumnSet::columnGap() const > // go to the parent block to get the gap. > RenderBlockFlow& parentBlock = downcast<RenderBlockFlow>(*parent()); > if (parentBlock.style().columnGap().isNormal()) >- return parentBlock.style().fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins. >+ return parentBlock.style().fontDescription().computedSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins. > return valueForLength(parentBlock.style().columnGap().length(), parentBlock.availableLogicalWidth()); > } > >diff --git a/Source/WebCore/rendering/RenderRubyRun.cpp b/Source/WebCore/rendering/RenderRubyRun.cpp >index 161e94a518f899f4c720210f127f36e580a03968..1ce5391d0865a7e460eef2b24265a909bdada2fc 100644 >--- a/Source/WebCore/rendering/RenderRubyRun.cpp >+++ b/Source/WebCore/rendering/RenderRubyRun.cpp >@@ -215,7 +215,7 @@ static bool shouldOverhang(bool firstLine, const RenderObject* renderer, const R > return false; > const RenderStyle& rubyBaseStyle = firstLine ? rubyBase.firstLineStyle() : rubyBase.style(); > const RenderStyle& style = firstLine ? renderer->firstLineStyle() : renderer->style(); >- return style.computedFontPixelSize() <= rubyBaseStyle.computedFontPixelSize(); >+ return style.computedFontSize() <= rubyBaseStyle.computedFontSize(); > } > > void RenderRubyRun::getOverhang(bool firstLine, RenderObject* startRenderer, RenderObject* endRenderer, float& startOverhang, float& endOverhang) const >@@ -254,7 +254,7 @@ void RenderRubyRun::getOverhang(bool firstLine, RenderObject* startRenderer, Ren > // We can overhang the ruby by no more than half the width of the neighboring text > // and no more than half the font size. > const RenderStyle& rubyTextStyle = firstLine ? rubyText->firstLineStyle() : rubyText->style(); >- float halfWidthOfFontSize = rubyTextStyle.computedFontPixelSize() / 2.; >+ float halfWidthOfFontSize = rubyTextStyle.computedFontSize() / 2; > if (startOverhang) > startOverhang = std::min(startOverhang, std::min(downcast<RenderText>(*startRenderer).minLogicalWidth(), halfWidthOfFontSize)); > if (endOverhang) >diff --git a/Source/WebCore/rendering/RenderRubyText.cpp b/Source/WebCore/rendering/RenderRubyText.cpp >index f5cd9f135061989a8ae1e10881a5cb59eb165e77..91c939db0302597a6b35667905e30f72408c4b33 100644 >--- a/Source/WebCore/rendering/RenderRubyText.cpp >+++ b/Source/WebCore/rendering/RenderRubyText.cpp >@@ -83,7 +83,7 @@ void RenderRubyText::adjustInlineDirectionLineBounds(int expansionOpportunityCou > // ruby character on each side. > float inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpportunityCount + 1); > if (expansionOpportunityCount) >- inset = std::min<float>(2 * style().computedFontPixelSize(), inset); >+ inset = std::min(2 * style().computedFontSize(), inset); > > logicalLeft += inset / 2; > logicalWidth -= inset; >diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp >index 54013e347724ac63981cc90bbc2ca8d5f1fa031c..b5a0f628b2390a67dbdcf342aca22913caa4e69a 100644 >--- a/Source/WebCore/rendering/RenderText.cpp >+++ b/Source/WebCore/rendering/RenderText.cpp >@@ -748,7 +748,7 @@ static float maxWordFragmentWidth(RenderText& renderer, const RenderStyle& style > hyphenLocations.reverse(); > > // FIXME: Breaking the string at these places in the middle of words is completely broken with complex text. >- float minimumFragmentWidthToConsider = font.pixelSize() * 5 / 4 + hyphenWidth(renderer, font); >+ float minimumFragmentWidthToConsider = font.size() * 5 / 4 + hyphenWidth(renderer, font); > float maxFragmentWidth = 0; > for (size_t k = 0; k < hyphenLocations.size(); ++k) { > int fragmentLength = hyphenLocations[k] - suffixStart; >diff --git a/Source/WebCore/rendering/RenderThemeIOS.mm b/Source/WebCore/rendering/RenderThemeIOS.mm >index cb46644f35843a7ca9dfc42b2a99707c8f946772..2c599140b5c64f277a01bf7e9033d66bdf4a178a 100644 >--- a/Source/WebCore/rendering/RenderThemeIOS.mm >+++ b/Source/WebCore/rendering/RenderThemeIOS.mm >@@ -354,7 +354,7 @@ void RenderThemeIOS::adjustCheckboxStyle(StyleResolver&, RenderStyle& style, con > if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto()) > return; > >- int size = std::max(style.computedFontPixelSize(), 10U); >+ int size = std::max(style.computedFontSize(), 10.0f); > style.setWidth({ size, Fixed }); > style.setHeight({ size, Fixed }); > } >@@ -475,7 +475,7 @@ void RenderThemeIOS::adjustRadioStyle(StyleResolver&, RenderStyle& style, const > if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto()) > return; > >- int size = std::max(style.computedFontPixelSize(), 10U); >+ int size = std::max(style.computedFontSize(), 10.0f); > style.setWidth({ size, Fixed }); > style.setHeight({ size, Fixed }); > style.setBorderRadius({ size / 2, size / 2 }); >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index c7375fa018e00cf9f862f1441db6913ad72322fb..322319395d1c5ccfad35d6de22551606abd2e7bd 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -1034,7 +1034,7 @@ bool RenderThemeMac::controlSupportsTints(const RenderObject& o) const > > NSControlSize RenderThemeMac::controlSizeForFont(const RenderStyle& style) const > { >- int fontSize = style.computedFontPixelSize(); >+ auto fontSize = style.computedFontSize(); > if (fontSize >= 16) > return NSControlSizeRegular; > if (fontSize >= 11) >@@ -1109,7 +1109,7 @@ void RenderThemeMac::setFontFromControlSize(StyleResolver&, RenderStyle& style, > > NSControlSize RenderThemeMac::controlSizeForSystemFont(const RenderStyle& style) const > { >- int fontSize = style.computedFontPixelSize(); >+ auto fontSize = style.computedFontSize(); > if (fontSize >= [NSFont systemFontSizeForControlSize:NSControlSizeRegular]) > return NSControlSizeRegular; > if (fontSize >= [NSFont systemFontSizeForControlSize:NSControlSizeSmall]) >@@ -1622,7 +1622,7 @@ bool RenderThemeMac::paintMenuListButtonDecorations(const RenderBox& renderer, c > paintMenuListButtonGradients(renderer, paintInfo, bounds); > > // Since we actually know the size of the control here, we restrict the font scale to make sure the arrows will fit vertically in the bounds >- float fontScale = std::min(renderer.style().computedFontPixelSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows)); >+ float fontScale = std::min(renderer.style().computedFontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows)); > float centerY = bounds.y() + bounds.height() / 2.0f; > float arrowHeight = baseArrowHeight * fontScale; > float arrowWidth = baseArrowWidth * fontScale; >@@ -1730,7 +1730,7 @@ LengthBox RenderThemeMac::popupInternalPaddingBox(const RenderStyle& style) cons > } > > if (style.appearance() == MenulistButtonPart) { >- float arrowWidth = baseArrowWidth * (style.computedFontPixelSize() / baseFontSize); >+ float arrowWidth = baseArrowWidth * (style.computedFontSize() / baseFontSize); > float rightPadding = ceilf(arrowWidth + (arrowPaddingBefore + arrowPaddingAfter + paddingBeforeSeparator) * style.effectiveZoom()); > float leftPadding = styledPopupPaddingLeft * style.effectiveZoom(); > if (style.direction() == TextDirection::RTL) >@@ -1762,7 +1762,7 @@ PopupMenuStyle::PopupMenuSize RenderThemeMac::popupMenuSize(const RenderStyle& s > > void RenderThemeMac::adjustMenuListButtonStyle(StyleResolver&, RenderStyle& style, const Element*) const > { >- float fontScale = style.computedFontPixelSize() / baseFontSize; >+ float fontScale = style.computedFontSize() / baseFontSize; > > style.resetPadding(); > style.setBorderRadius(IntSize(int(baseBorderRadius + fontScale - 1), int(baseBorderRadius + fontScale - 1))); // FIXME: Round up? >diff --git a/Source/WebCore/rendering/RootInlineBox.cpp b/Source/WebCore/rendering/RootInlineBox.cpp >index 1999764789db57060ff241c59beda9befc9075dc..175af0a3297edb2fbc54405817b3e51f6cf3fba7 100644 >--- a/Source/WebCore/rendering/RootInlineBox.cpp >+++ b/Source/WebCore/rendering/RootInlineBox.cpp >@@ -1026,7 +1026,7 @@ LayoutUnit RootInlineBox::verticalPositionForBox(InlineBox* box, VerticalPositio > const RenderStyle& parentLineStyle = firstLine ? parent->firstLineStyle() : parent->style(); > const FontCascade& font = parentLineStyle.fontCascade(); > const FontMetrics& fontMetrics = font.fontMetrics(); >- int fontSize = font.pixelSize(); >+ auto fontSize = font.size(); > > LineDirectionMode lineDirection = parent->isHorizontalWritingMode() ? HorizontalLine : VerticalLine; > >diff --git a/Source/WebCore/rendering/SimpleLineLayout.cpp b/Source/WebCore/rendering/SimpleLineLayout.cpp >index e0c7bea71a0cf07af3eb042af723a996cd53c8bb..e4a9b7d42a571e2d58fa05044fd378f67b38e355 100644 >--- a/Source/WebCore/rendering/SimpleLineLayout.cpp >+++ b/Source/WebCore/rendering/SimpleLineLayout.cpp >@@ -630,7 +630,7 @@ static std::optional<unsigned> hyphenPositionForFragment(SplitFragmentData split > auto adjustedAvailableWidth = availableWidth - style.hyphenStringWidth; > if (!line.isEmpty()) > adjustedAvailableWidth += style.font.spaceWidth(); >- if (!enoughWidthForHyphenation(adjustedAvailableWidth, style.font.pixelSize())) >+ if (!enoughWidthForHyphenation(adjustedAvailableWidth, style.font.size())) > return std::nullopt; > > // We might be able to fit the hyphen at the split position. >diff --git a/Source/WebCore/rendering/TextDecorationPainter.cpp b/Source/WebCore/rendering/TextDecorationPainter.cpp >index 98e88dc4805d6a5da7aa54205ddb16e741698980..2a3854b7040ef47e85ce373bd83d73fb159a7fba 100644 >--- a/Source/WebCore/rendering/TextDecorationPainter.cpp >+++ b/Source/WebCore/rendering/TextDecorationPainter.cpp >@@ -264,7 +264,7 @@ void TextDecorationPainter::paintTextDecoration(const TextRun& textRun, const Fl > UNUSED_PARAM(textOrigin); > #endif > ASSERT(m_font); >- float textDecorationThickness = textDecorationStrokeThickness(m_lineStyle.computedFontPixelSize()); >+ float textDecorationThickness = textDecorationStrokeThickness(m_lineStyle.computedFontSize()); > m_context.setStrokeThickness(textDecorationThickness); > FloatPoint localOrigin = boxOrigin; > >@@ -274,7 +274,7 @@ void TextDecorationPainter::paintTextDecoration(const TextRun& textRun, const Fl > auto strokeStyle = textDecorationStyleToStrokeStyle(style); > > if (style == TextDecorationStyle::Wavy) >- strokeWavyTextDecoration(m_context, start, end, textDecorationThickness, m_lineStyle.computedFontPixelSize()); >+ strokeWavyTextDecoration(m_context, start, end, textDecorationThickness, m_lineStyle.computedFontSize()); > else if (decoration == TextDecoration::Underline || decoration == TextDecoration::Overline) { > #if ENABLE(CSS3_TEXT_DECORATION_SKIP_INK) > if ((m_lineStyle.textDecorationSkip() == TextDecorationSkip::Ink || m_lineStyle.textDecorationSkip() == TextDecorationSkip::Auto) && m_isHorizontal) { >diff --git a/Source/WebCore/rendering/line/BreakingContext.h b/Source/WebCore/rendering/line/BreakingContext.h >index fd919cf541e812c29be58f8fe05210b7b867a755..9b9987c7fa98b9bb2c57ccc4a845c9c104e3f0ef 100644 >--- a/Source/WebCore/rendering/line/BreakingContext.h >+++ b/Source/WebCore/rendering/line/BreakingContext.h >@@ -668,7 +668,7 @@ inline void tryHyphenating(RenderText& text, const FontCascade& font, const Atom > float hyphenWidth = measureHyphenWidth(text, font); > > float maxPrefixWidth = availableWidth - xPos - hyphenWidth - lastSpaceWordSpacing; >- if (!enoughWidthForHyphenation(maxPrefixWidth, font.pixelSize())) >+ if (!enoughWidthForHyphenation(maxPrefixWidth, font.size())) > return; > > const RenderStyle& style = text.style(); >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp >index 0505ef0aee2d7143d6fe4adc229663b39ad2e5d4..ee04d6fb0b77138182dd4ba205cb4fbc79859b07 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp >@@ -90,7 +90,7 @@ void RenderMathMLRow::stretchVerticalOperatorsAndLayoutChildren() > } > if (stretchAscent + stretchDescent <= 0) { > // We ensure a minimal stretch size. >- stretchAscent = style().computedFontPixelSize(); >+ stretchAscent = style().computedFontSize(); > stretchDescent = 0; > } > >diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp >index 38097d2212930e00533015df4fe87c29db690733..5f45e9bdff68186578426a8ffa5b58dbc7df58e1 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.cpp >+++ b/Source/WebCore/rendering/style/RenderStyle.cpp >@@ -1533,11 +1533,6 @@ float RenderStyle::computedFontSize() const > return fontDescription().computedSize(); > } > >-unsigned RenderStyle::computedFontPixelSize() const >-{ >- return fontDescription().computedPixelSize(); >-} >- > const Length& RenderStyle::wordSpacing() const > { > return m_rareInheritedData->wordSpacing; >@@ -1594,7 +1589,7 @@ int RenderStyle::computedLineHeight() const > return fontMetrics().lineSpacing(); > > if (lh.isPercentOrCalculated()) >- return minimumValueForLength(lh, computedFontPixelSize()); >+ return minimumValueForLength(lh, computedFontSize()); > > return clampTo<int>(lh.value()); > } >diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h >index a208500f07bfede7c2c8c7beaf27088a05577237..b2355ac28536f80984dc75fd8edc7ba900a1cd5d 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -354,7 +354,6 @@ public: > WEBCORE_EXPORT const FontCascadeDescription& fontDescription() const; > float specifiedFontSize() const; > float computedFontSize() const; >- unsigned computedFontPixelSize() const; > std::pair<FontOrientation, NonCJKGlyphOrientation> fontAndGlyphOrientation(); > > #if ENABLE(VARIATION_FONTS) >diff --git a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp >index 892202151836b91a7f4b91ce918282f4ecc79cef..a5cd489376703655728ca340e3b4f6ea8f8bba46 100644 >--- a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp >+++ b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp >@@ -170,9 +170,9 @@ LayoutRect SVGInlineTextBox::localSelectionRect(unsigned startPosition, unsigned > > static inline bool textShouldBePainted(const RenderSVGInlineText& textRenderer) > { >- // FontCascade::pixelSize(), returns FontDescription::computedPixelSize(), which returns "int(x + 0.5)". >+ // FontCascade::size(), returns FontDescription::computedPixelSize(), which returns "int(x + 0.5)". > // If the absolute font size on screen is below x=0.5, don't render anything. >- return textRenderer.scaledFont().pixelSize(); >+ return textRenderer.scaledFont().size(); > } > > void SVGInlineTextBox::paintSelectionBackground(PaintInfo& paintInfo) >diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp b/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp >index 0b63d6cdffb55a42ea904598a01d1e6e29aef2fa..70a09e2f3d18ee69d6c7e95a9567b5b470031a43 100644 >--- a/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp >+++ b/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp >@@ -38,7 +38,7 @@ float SVGTextLayoutEngineBaseline::calculateBaselineShift(const SVGRenderStyle& > if (style.baselineShift() == BaselineShift::Length) { > auto baselineShiftValueLength = style.baselineShiftValue(); > if (baselineShiftValueLength.unitType() == LengthTypePercentage) >- return baselineShiftValueLength.valueAsPercentage() * m_font.pixelSize(); >+ return baselineShiftValueLength.valueAsPercentage() * m_font.size(); > > SVGLengthContext lengthContext(context); > return baselineShiftValueLength.value(lengthContext); >diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutEngineSpacing.cpp b/Source/WebCore/rendering/svg/SVGTextLayoutEngineSpacing.cpp >index 48d80ae9926e063d9ef219242d3de78178ece4e5..1d7a36fe8c88c3899aea964ff9e0e2348097bad6 100644 >--- a/Source/WebCore/rendering/svg/SVGTextLayoutEngineSpacing.cpp >+++ b/Source/WebCore/rendering/svg/SVGTextLayoutEngineSpacing.cpp >@@ -42,7 +42,7 @@ float SVGTextLayoutEngineSpacing::calculateCSSKerningAndSpacing(const SVGRenderS > float kerning = 0; > auto kerningLength = style->kerning(); > if (kerningLength.unitType() == LengthTypePercentage) >- kerning = kerningLength.valueAsPercentage() * m_font.pixelSize(); >+ kerning = kerningLength.valueAsPercentage() * m_font.size(); > else { > SVGLengthContext lengthContext(contextElement); > kerning = kerningLength.value(lengthContext); >diff --git a/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp b/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp >index 8fd021d1838a1ba9ae5008760964c6534cc9c2a8..acb872736a3278129cd81af57aa949b5ce71b440 100644 >--- a/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp >+++ b/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp >@@ -62,7 +62,7 @@ static RenderStyle styleForFirstLetter(const RenderBlock& firstLetterBlock, cons > // Set the font to be one line too big and then ratchet back to get to a precise fit. We can't just set the desired font size based off font height metrics > // because many fonts bake ascent into the font metrics. Therefore we have to look at actual measured cap height values in order to know when we have a good fit. > auto newFontDescription = firstLetterStyle.fontDescription(); >- float capRatio = firstLetterStyle.fontMetrics().floatCapHeight() / firstLetterStyle.computedFontPixelSize(); >+ float capRatio = firstLetterStyle.fontMetrics().floatCapHeight() / firstLetterStyle.computedFontSize(); > float startingFontSize = ((firstLetterStyle.initialLetterHeight() - 1) * lineHeight + paragraph->style().fontMetrics().capHeight()) / capRatio; > newFontDescription.setSpecifiedSize(startingFontSize); > newFontDescription.setComputedSize(startingFontSize); >diff --git a/Source/WebCore/style/InlineTextBoxStyle.cpp b/Source/WebCore/style/InlineTextBoxStyle.cpp >index 136f31a8ebb90bcc28da076986730c17c9823118..ec9b70bf6c9c26686343f120467b26462cb5bdb9 100644 >--- a/Source/WebCore/style/InlineTextBoxStyle.cpp >+++ b/Source/WebCore/style/InlineTextBoxStyle.cpp >@@ -110,7 +110,7 @@ GlyphOverflow visualOverflowForDecorations(const RenderStyle& lineStyle, const I > if (decoration.isEmpty()) > return GlyphOverflow(); > >- float strokeThickness = textDecorationStrokeThickness(lineStyle.computedFontPixelSize()); >+ float strokeThickness = textDecorationStrokeThickness(lineStyle.computedFontSize()); > float controlPointDistance = 0; > float step; > float wavyOffset = 0; >@@ -120,7 +120,7 @@ GlyphOverflow visualOverflowForDecorations(const RenderStyle& lineStyle, const I > GlyphOverflow overflowResult; > > if (decorationStyle == TextDecorationStyle::Wavy) { >- getWavyStrokeParameters(lineStyle.computedFontPixelSize(), controlPointDistance, step); >+ getWavyStrokeParameters(lineStyle.computedFontSize(), controlPointDistance, step); > wavyOffset = wavyOffsetFromDecoration(); > overflowResult.left = strokeThickness; > overflowResult.right = strokeThickness; >diff --git a/Source/WebCore/style/StyleTreeResolver.cpp b/Source/WebCore/style/StyleTreeResolver.cpp >index 29c2be02df749e567de82084890ab972cf4da326..42d68e5f1821a5d649513bc6941fe8eae0351f2e 100644 >--- a/Source/WebCore/style/StyleTreeResolver.cpp >+++ b/Source/WebCore/style/StyleTreeResolver.cpp >@@ -217,7 +217,7 @@ ElementUpdates TreeResolver::resolveElement(Element& element) > m_documentElementStyle = RenderStyle::clonePtr(*update.style); > scope().styleResolver.setOverrideDocumentElementStyle(m_documentElementStyle.get()); > >- if (update.change != NoChange && existingStyle && existingStyle->computedFontPixelSize() != update.style->computedFontPixelSize()) { >+ if (update.change != NoChange && existingStyle && existingStyle->computedFontSize() != update.style->computedFontSize()) { > // "rem" units are relative to the document element's font size so we need to recompute everything. > // In practice this is rare. > scope().styleResolver.invalidateMatchedPropertiesCache(); >diff --git a/Source/WebCore/svg/SVGLengthContext.cpp b/Source/WebCore/svg/SVGLengthContext.cpp >index 08000176bac0fb90fea350ffd62e56ec4bbc129e..e70f605eebdb5fdc9a3d5977f6062fa042b034cd 100644 >--- a/Source/WebCore/svg/SVGLengthContext.cpp >+++ b/Source/WebCore/svg/SVGLengthContext.cpp >@@ -241,7 +241,7 @@ ExceptionOr<float> SVGLengthContext::convertValueFromUserUnitsToEMS(float value) > if (!style) > return Exception { NotSupportedError }; > >- float fontSize = style->computedFontPixelSize(); >+ auto fontSize = style->computedFontSize(); > if (!fontSize) > return Exception { NotSupportedError }; > >@@ -254,7 +254,7 @@ ExceptionOr<float> SVGLengthContext::convertValueFromEMSToUserUnits(float value) > if (!style) > return Exception { NotSupportedError }; > >- return value * style->computedFontPixelSize(); >+ return value * style->computedFontSize(); > } > > ExceptionOr<float> SVGLengthContext::convertValueFromUserUnitsToEXS(float value) const
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 46987
:
164498
|
349244
|
349245
|
349247