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-220970-20210126155542.patch (text/plain), 3.62 KB, created by
Rob Buis
on 2021-01-26 06:55:44 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2021-01-26 06:55:44 PST
Size:
3.62 KB
patch
obsolete
>Subversion Revision: 271880 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 7033ee1bab3a180e0e7ffacfde1af5368de43871..fe9f867cf4eb5c059e73a9ab92df6929284688c8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2021-01-26 Rob Buis <rbuis@igalia.com> >+ >+ Handle zero aspect-ratio width/height >+ https://bugs.webkit.org/show_bug.cgi?id=220970 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Treat aspect-ratio's with zero width/height internally >+ as auto, but when serializing keep the original input. >+ >+ * css/CSSComputedStyleDeclaration.cpp: >+ (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): >+ * style/StyleBuilderCustom.h: >+ (WebCore::Style::BuilderCustom::applyValueAspectRatio): >+ > 2021-01-26 Kimmo Kinnunen <kkinnunen@apple.com> > > WebGL power preference and discrete/internal gpu selection implemented incorrectly with ANGLE >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index 1bf275330f698ce274e297f8910ff715d751c42e..243fc386a3f144f0603d03c87addc47c7893a94f 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -3471,13 +3471,15 @@ RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty > case CSSPropertyAspectRatio: > switch (style.aspectRatioType()) { > case AspectRatioType::Auto: >- return cssValuePool.createIdentifierValue(CSSValueAuto); >+ if (style.aspectRatioWidth() > 0 && style.aspectRatioHeight() > 0) >+ return cssValuePool.createIdentifierValue(CSSValueAuto); >+ FALLTHROUGH; > case AspectRatioType::AutoAndRatio: > case AspectRatioType::Ratio: { > auto ratioList = CSSValueList::createSlashSeparated(); > ratioList->append(cssValuePool.createValue(style.aspectRatioWidth(), CSSUnitType::CSS_NUMBER)); > ratioList->append(cssValuePool.createValue(style.aspectRatioHeight(), CSSUnitType::CSS_NUMBER)); >- if (style.aspectRatioType() == AspectRatioType::Ratio) >+ if (style.aspectRatioType() != AspectRatioType::AutoAndRatio) > return ratioList; > auto list = CSSValueList::createSpaceSeparated(); > list->append(cssValuePool.createIdentifierValue(CSSValueAuto)); >diff --git a/Source/WebCore/style/StyleBuilderCustom.h b/Source/WebCore/style/StyleBuilderCustom.h >index 290de4535f89579ac39c98de81447dde1613d966..6d98161b795a394c6c6dbbc3e04266fa7ee1b28a 100644 >--- a/Source/WebCore/style/StyleBuilderCustom.h >+++ b/Source/WebCore/style/StyleBuilderCustom.h >@@ -1179,9 +1179,14 @@ inline void BuilderCustom::applyValueAspectRatio(BuilderState& builderState, CSS > return; > } > >- builderState.style().setAspectRatioType(AspectRatioType::Ratio); > ASSERT(list.length() == 2); >- builderState.style().setAspectRatio(downcast<CSSPrimitiveValue>(list.item(0))->doubleValue(), downcast<CSSPrimitiveValue>(list.item(1))->doubleValue()); >+ auto width = downcast<CSSPrimitiveValue>(list.item(0))->doubleValue(); >+ auto height = downcast<CSSPrimitiveValue>(list.item(1))->doubleValue(); >+ if (!width || !height) >+ builderState.style().setAspectRatioType(AspectRatioType::Auto); >+ else >+ builderState.style().setAspectRatioType(AspectRatioType::Ratio); >+ builderState.style().setAspectRatio(width, height); > } > > inline void BuilderCustom::applyValueWebkitTextEmphasisStyle(BuilderState& builderState, CSSValue& value)
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 220970
:
418389
|
418413
|
418464
|
418520
|
418524
|
418531