Bug 94352

Summary: WebKit incorrectly accepts percentage for number values due to the use of value.toFloat()
Product: WebKit Reporter: Dirk Schulze <krit>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, fmalita, koivisto, maggotfish, mmaxfield, ntim, pdr, rniwa, webkit-bug-importer, zimmermann
Priority: P2 Keywords: BrowserCompat, InRadar, LayerBasedSVGEngine
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
feOffset, where dx/dy have 50% as value
none
Safari 15.5 differs from other browsers none

Dirk Schulze
Reported 2012-08-17 09:43:04 PDT
Created attachment 159143 [details] feOffset, where dx/dy have 50% as value For parsing <number> values in SVG, we use toFloat(). Sadly this function is not very restrictive. E.g. "50%" gets parsed as 50. Which shouldn't be the case.
Attachments
feOffset, where dx/dy have 50% as value (402 bytes, image/svg+xml)
2012-08-17 09:43 PDT, Dirk Schulze
no flags
Safari 15.5 differs from other browsers (558.85 KB, image/png)
2022-07-18 10:28 PDT, Ahmad Saleem
no flags
Ahmad Saleem
Comment 1 2022-07-18 10:28:36 PDT
Created attachment 460981 [details] Safari 15.5 differs from other browsers I am able to reproduce this bug in Safari 15.5 on macOS 12.4 based on attached test case. As can be seen in the attached screenshot, Safari does not show full green square but has 'Red' in it while all other browsers show just "Green". If I am testing incorrectly and Safari behavior is correct then ignore my comment or test accordingly. Thanks!
Radar WebKit Bug Importer
Comment 2 2022-07-18 11:52:26 PDT
Note You need to log in before you can comment on or make changes to this bug.