[Webkit-unassigned] [Bug 64546] Redrawing dirty parts of a large table is very slow
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Sep 9 10:40:54 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=64546
--- Comment #22 from Julien Chaffraix <jchaffraix at webkit.org> 2011-09-09 10:40:53 PST ---
(In reply to comment #19)
> > > Well, probably I just don't know some trick how it is accessed from JS.
> > > Can you give me hint?
> > > Is there way to get collapsed border values in JS?
> >
> > Sure, here is how you can access the border value through JS:
> >
> > var cell = document.getElementById('thisCell');
> > getComputedStyle(cell, '').borderLeftWidth
>
> I don't observe that in JS you access collapsed border values.
> I think that collapsed borders are paint/presentation feature instead of style feature.
I am not sure why you are making some distinction here. getComputedStyle should return the computed value for the property. borderLeftWidth is a layout value which is derived from the different style properties.
> <body onload="test()">
> <table style="border-collapse:collapse; border:2px solid blue">
> <tr>
> <td style="border:4px solid lime" id="foo"/>
> <td style="border-left:6px solid yellow" id="bar"/>
> <td/>
> </tr>
> </table>
> <div id="console"/>
> </body>
>
> function test() {
> fooCell = document.getElementById("foo");
> barCell = document.getElementById("bar");
> log("foo borderRightWidth: " + getComputedStyle(fooCell, '').borderRightWidth);
> log("bar borderLeftWidth: " + getComputedStyle(barCell, '').borderLeftWidth);
> }
>
> RenderBlock {DIV} at (0,70) size 784x56
> RenderBlock {P} at (0,0) size 784x20
> RenderText {#text} at (0,0) size 163x19
> text run at (0,0) width 163: "foo borderRightWidth: 4px"
> RenderBlock {P} at (0,36) size 784x20
> RenderText {#text} at (0,0) size 156x19
> text run at (0,0) width 156: "bar borderLeftWidth: 6px"
Looks like the values returned by getComputedStyle don't take into account the border-collapse indeed. We match IE and Opera here (FF being the only one returning the collapsed computed values).
> > Maybe more importantly, all the virtual border* method on RenderTableCell will still trigger a recomputation and completely miss the cache. The invocations of those function are spread in the rendering code but they are nevertheless important.
>
> RenderTable.paintObject() asks every RenderTableCell about its collapsed border, so if table is huge, this takes a lot of time.
> In contrast RenderTableCell talks only with its direct parents and siblings.
> Single RenderTableCell::collapsedStartBorder() method requires about 1/1000 ms on my computer.
> Can we however do this in separate bug?
I agree with your assessment and that it can be postponed.
> > I feared setting the size to 0 in CollapsedBorderValues would actually hurt other use cases: when you *do* need to collect borders, you can easily need 100 entries in your Vector. 100 entries is only 25 cells (4 borders per cell). You could mitigate that by pre-allocating the Vector before collecting your borders as you can estimate the size needed.
>
> As I can see, even for huge table CollapsedBorderValues contains only 2 elements, because we remember only unique CollapsedBorderValue objects.
Indeed, I missed that addBorderStyle checks for unique style before adding it.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list