[webkit-reviews] review granted: [Bug 97706] Scroll offset of flex items lost during relayout : [Attachment 166085] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 27 16:21:05 PDT 2012


Ojan Vafai <ojan at chromium.org> has granted Kenneth Rohde Christiansen
<kenneth at webkit.org>'s request for review:
Bug 97706: Scroll offset of flex items lost during relayout
https://bugs.webkit.org/show_bug.cgi?id=97706

Attachment 166085: Patch
https://bugs.webkit.org/attachment.cgi?id=166085&action=review

------- Additional Comments from Ojan Vafai <ojan at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=166085&action=review


Looks great. I have a bunch of nits about the test. It's not official style
rules obviously, but keeping tests smaller is good practice IMO. Feel free to
skip any bits you disagree with.

> LayoutTests/fast/flexbox/overflow-keep-scrollpos.html:27
> +    if (window.testRunner)
> +	   testRunner.dumpAsText();
> +
> +    function log(message)
> +    {
> +	  
document.querySelector("#console").appendChild(document.createTextNode(message
+ "\n"));
> +    }

How about importing js-test-pre.js? Then you wouldn't need to define any of
this.

> LayoutTests/fast/flexbox/overflow-keep-scrollpos.html:41
> +	   if (scrollPos === 50)
> +	       log("SUCCESS")
> +	   else
> +	       log("FAIL: scrolltop should be 50, was: " + scrollPos)

With js-test-pre.js these four lines would just be:
shouldBe("document.querySelector('.overflow-auto').scrollTop", "50");

> LayoutTests/fast/flexbox/overflow-keep-scrollpos.html:46
> +<body onload="runTest()">

Can you move the script tag to the end of the body element? Then you don't need
to run it onload and you don't need the runTest method at all. Not a big deal,
but it makes the test a bit smaller.

> LayoutTests/fast/flexbox/overflow-keep-scrollpos.html:57
> +	       <p>...</p>
> +	       <p>...</p>
> +	       <p>...</p>
> +	       <p>...</p>
> +	       <p>...</p>
> +	       <p>...</p>
> +	       <p>...</p>
> +	       <p>...</p>

How about just putting a single, 200px div in here? Makes for a more reduced
test.


More information about the webkit-reviews mailing list