Bug 262594 - Serialize the path() function with double quotes
Summary: Serialize the path() function with double quotes
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, WPTImpact
Depends on:
Blocks:
 
Reported: 2023-10-03 18:10 PDT by Ahmad Saleem
Modified: 2023-10-03 18:43 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2023-10-03 18:10:55 PDT
Hi Team,

While trying to understand some failures in SVG (worst one - Path), I noticed following Blink commit might be mergeable or can be explored:

Blink Commit: https://chromium-review.googlesource.com/c/chromium/src/+/1213171

WebKit Source: https://searchfox.org/wubkat/source/Source/WebCore/css/CSSBasicShapes.cpp#397

String CSSPathValue::customCSSText() const
{
    String pathString;
    buildStringFromByteStream(m_pathData, pathString, UnalteredParsing);
    StringBuilder result;
    if (m_windRule == WindRule::EvenOdd)
        result.append("path(evenodd, "_s);
    else
        result.append("path("_s);
    serializeString(pathString, result);
    result.append(')');
    return result.toString();
}

^ We need to update to ensure that it accounts for 'double quotes'.

__

It will lead to progressing some failing test cases on WPT.

Just wanted to raise, so we can fix it.

CCing - some CSS folks - @Tim & @Simon to get their input.

Thanks!
Comment 1 Ahmad Saleem 2023-10-03 18:19:09 PDT
This compiles but don't progress test:

String CSSPathValue::customCSSText() const
{
    String pathString;
    buildStringFromByteStream(m_pathData, pathString, UnalteredParsing);
    StringBuilder result;
    if (m_windRule == WindRule::EvenOdd)
        result.append("path(evenodd, "_s);
    else
        result.append("path(\""_s);
    serializeString(pathString, result);
    result.append("\")"_s);
    return result.toString();
}

at least while running few in Minibrowsers.
Comment 2 Ahmad Saleem 2023-10-03 18:32:36 PDT
Latest in Chrome / Blink:

String CSSPathValue::CustomCSSText() const {
  StringBuilder result;
  result.Append("path(");
  if (style_path_->GetWindRule() == RULE_EVENODD) {
    result.Append("evenodd, ");
  }
  result.Append("\"");
  result.Append(BuildStringFromByteStream(ByteStream(), serialization_format_));
  result.Append("\")");
  return result.ReleaseString();
}