Bug 106107

Summary: REGRESSION(SUBPIXEL_LAYOUT): el.offsetWidth < el.clientWidth for elements of a certain size
Product: WebKit Reporter: Brad Vogel <bradavogel>
Component: Layout and RenderingAssignee: Emil A Eklund <eae>
Status: RESOLVED FIXED    
Severity: Normal CC: bradavogel, eae, eric, leviw, me, ojan.autocc, rniwa, simon.fraser, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Original repro case
none
Patch none

Brad Vogel
Reported 2013-01-04 10:39:31 PST
Repro: 1) Run the attached file in Chrome 21 or later, or Webkit Nightly. Actual Result: You will see the alert "BUG: offsetWidth is smaller than clientWidth". Expected Result: You will see the alert "NO BUG: unable to repro" Tested in: Firefox 17.0.1: PASS Chrome 20: PASS Safari 6.0.2 (7536.26.17): PASS Chrome 21: FAIL Chrome Canary 26.0.1374.1: FAIL Webkit Nightly Version 6.0.2 (7536.26.17, 537+): FAIL Notes: Per the W3C spec, offsetWidth should never be smaller than clientWidth. If you change the attached repro case to use "margin: 1.2em" instead of "margin: 1.1em", it will not repro the bug. Impact: This breaks scripts that use the following code to check if an element is scrollable: var isScrollable = el.offsetWidth < el.scrollWidth; because if the bug is reproducing, offsetWidth will be smaller than clientWidth, but scrollWidth will equal clientWidth.
Attachments
Original repro case (348 bytes, text/html)
2013-01-04 10:40 PST, Brad Vogel
no flags
Patch (5.76 KB, patch)
2013-01-07 15:33 PST, Emil A Eklund
no flags
Brad Vogel
Comment 1 2013-01-04 10:40:17 PST
Created attachment 181330 [details] Original repro case
Alexey Proskuryakov
Comment 2 2013-01-07 10:13:55 PST
Emil A Eklund
Comment 3 2013-01-07 13:25:49 PST
Looking into this now.
Emil A Eklund
Comment 4 2013-01-07 15:33:46 PST
Levi Weintraub
Comment 5 2013-01-07 15:39:36 PST
Comment on attachment 181577 [details] Patch LGTM.
Brad Vogel
Comment 6 2013-01-07 15:51:56 PST
LGTM!
Levi Weintraub
Comment 7 2013-01-07 15:56:53 PST
You may want to merge this into m25 given it's super low risk and high return.
WebKit Review Bot
Comment 8 2013-01-07 16:44:18 PST
Comment on attachment 181577 [details] Patch Clearing flags on attachment: 181577 Committed r139013: <http://trac.webkit.org/changeset/139013>
WebKit Review Bot
Comment 9 2013-01-07 16:44:22 PST
All reviewed patches have been landed. Closing bug.
Ryosuke Niwa
Comment 10 2013-01-07 16:50:31 PST
This patch caused a build failure on Windows: http://build.webkit.org/builders/Apple%20Win%20Debug%20%28Build%29/builds/60388/steps/compile-webkit/logs/stdio 7>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification 7>WebCore.lib(RenderRegionSet.obj) : error LNK2005: "public: virtual int __thiscall WebCore::RenderBox::pixelSnappedOffsetWidth(void)const " (?pixelSnappedOffsetWidth@RenderBox@WebCore@@UBEHXZ) already defined in WebCore.lib(RenderingAllInOne.obj) 7>WebCore.lib(RenderRegionSet.obj) : error LNK2005: "public: virtual int __thiscall WebCore::RenderBox::pixelSnappedOffsetHeight(void)const " (?pixelSnappedOffsetHeight@RenderBox@WebCore@@UBEHXZ) already defined in WebCore.lib(RenderingAllInOne.obj) 7>WebCore.lib(MathMLInlineContainerElement.obj) : error LNK2005: "public: virtual int __thiscall WebCore::RenderBox::pixelSnappedOffsetWidth(void)const " (?pixelSnappedOffsetWidth@RenderBox@WebCore@@UBEHXZ) already defined in WebCore.lib(RenderingAllInOne.obj) 7>WebCore.lib(MathMLInlineContainerElement.obj) : error LNK2005: "public: virtual int __thiscall WebCore::RenderBox::pixelSnappedOffsetHeight(void)const " (?pixelSnappedOffsetHeight@RenderBox@WebCore@@UBEHXZ) already defined in WebCore.lib(RenderingAllInOne.obj) 7> Creating library C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\lib\WebKit.lib and object C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\lib\WebKit.exp 7>C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\bin\WebKit.dll : fatal error LNK1169: one or more multiply defined symbols found 7>Build log was saved at "file://C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\obj\WebKitLib\BuildLog.htm" It's probably a dependency problem though because I don't see RenderBox.cpp being recompiled.
Note You need to log in before you can comment on or make changes to this bug.