[webkit-reviews] review denied: [Bug 179022] Implement tab-size with units : [Attachment 371460] Update Layout Test And Result

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 5 18:45:47 PDT 2019


Simon Fraser (smfr) <simon.fraser at apple.com> has denied Joonghun Park
<jh718.park at samsung.com>'s request for review:
Bug 179022: Implement tab-size with units
https://bugs.webkit.org/show_bug.cgi?id=179022

Attachment 371460: Update Layout Test And Result

https://bugs.webkit.org/attachment.cgi?id=371460&action=review




--- Comment #14 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 371460
  --> https://bugs.webkit.org/attachment.cgi?id=371460
Update Layout Test And Result

View in context: https://bugs.webkit.org/attachment.cgi?id=371460&action=review

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3030
> +	       return cssValuePool.createValue(
> +		   style.tabSize().getPixelSize(1.0),
style.tabSize().isSpaces() ? CSSPrimitiveValue::CSS_NUMBER :
CSSPrimitiveValue::CSS_PX);

We don't wrap like this in WebKit code.

> Source/WebCore/css/StyleBuilderConverter.h:264
> +	   return TabSize(primitiveValue.floatValue(), true);

We prefer enum to bool arguments.

> Source/WebCore/css/parser/CSSPropertyParser.cpp:1126
> +    RefPtr<CSSPrimitiveValue> tabSize = consumeNumber(range,
ValueRangeNonNegative);

auto tabSize

> Source/WebCore/layout/inlineformatting/text/TextUtil.cpp:63
> +    if (tabWidth.getPixelSize(1.0))

Why does passing 1.0 as the spaceWidth make sense here?

> Source/WebCore/platform/graphics/TabSize.h:35
> +    TabSize(float numOrLength, bool isSpaces = true)

isSpaces should be an enum class with two values

> Source/WebCore/platform/graphics/TabSize.h:46
> +    float getPixelSize(float spaceWidth) const

widthInPixels?

> Source/WebCore/platform/graphics/TabSize.h:52
> +    unsigned m_isSpaces : 1;

No point using a bitfield here; the struct will get padded anyway. Just use a
bool.

> Source/WebCore/platform/graphics/TextRun.h:100
> +    void setTabSize(bool, TabSize);

Why is TabSize passed by value here, but by reference earlier?

> Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp:259
> +	   if (m_style.tabWidth.getPixelSize(1.0))

That mystery 1.0 again.


More information about the webkit-reviews mailing list