[Webkit-unassigned] [Bug 257084] New: Remove no-argument simplifyWhitespace
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat May 20 04:13:28 PDT 2023
https://bugs.webkit.org/show_bug.cgi?id=257084
Bug ID: 257084
Summary: Remove no-argument simplifyWhitespace
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Web Template Framework
Assignee: webkit-unassigned at lists.webkit.org
Reporter: annevk at annevk.nl
CC: darin at apple.com
Blocks: 255467
Making callers responsible for the type of whitespace they want simplified as the current default is wrong.
Now I have a patch for this as this seemed like a nice incremental step toward improving the whitespace situation, but it's not compiling as replacing existing callers with simplifyWhitespace(isSpaceOrNewline) is apparently not identical:
In file included from /Users/annevk/Dev/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource88.cpp:4:
accessibility/AccessibilityNodeObject.cpp:583:76: error: cannot initialize a parameter of type 'WTF::CodeUnitMatchFunction' (aka 'bool (*)(char16_t)') with an lvalue of type 'bool (UChar32)' (aka 'bool (int)'): type mismatch at 1st parameter ('UChar' (aka 'char16_t') vs 'UChar32' (aka 'int'))
String string = stringValue().stripWhiteSpace().simplifyWhiteSpace(isSpaceOrNewline);
In file included from /Users/annevk/Dev/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource88.cpp:1:
In file included from /Users/annevk/Dev/OpenSource/Source/WebCore/WebCorePrefix.h:168:
In file included from /Users/annevk/Dev/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/text/AtomString.h:25:
/Users/annevk/Dev/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/text/WTFString.h:199:90: note: passing argument to parameter here
WTF_EXPORT_PRIVATE String WARN_UNUSED_RETURN simplifyWhiteSpace(CodeUnitMatchFunction) const;
In file included from /Users/annevk/Dev/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource88.cpp:4:
accessibility/AccessibilityNodeObject.cpp:2448:90: error: cannot initialize a parameter of type 'WTF::CodeUnitMatchFunction' (aka 'bool (*)(char16_t)') with an lvalue of type 'bool (UChar32)' (aka 'bool (int)'): type mismatch at 1st parameter ('UChar' (aka 'char16_t') vs 'UChar32' (aka 'int'))
text = (element ? element->innerText() : node->textContent()).simplifyWhiteSpace(isSpaceOrNewline);
In file included from /Users/annevk/Dev/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource88.cpp:1:
In file included from /Users/annevk/Dev/OpenSource/Source/WebCore/WebCorePrefix.h:168:
In file included from /Users/annevk/Dev/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/text/AtomString.h:25:
/Users/annevk/Dev/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/text/WTFString.h:199:90: note: passing argument to parameter here
WTF_EXPORT_PRIVATE String WARN_UNUSED_RETURN simplifyWhiteSpace(CodeUnitMatchFunction) const;
2 errors generated.
I suppose I could make isSpaceOrNewline templated, but that feels like a step in the opposite direction.
Darin, any recommendations?
Referenced Bugs:
https://bugs.webkit.org/show_bug.cgi?id=255467
[Bug 255467] isASCIISpace vs isHTMLSpace
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230520/ac6e6b87/attachment-0001.htm>
More information about the webkit-unassigned
mailing list