RESOLVED FIXED 94587
Add methods to CounterDirectives to clean up StyleBuilder and RenderCounter.
https://bugs.webkit.org/show_bug.cgi?id=94587
Summary Add methods to CounterDirectives to clean up StyleBuilder and RenderCounter.
Elliott Sprehn
Reported 2012-08-21 04:18:42 PDT
Add methods to CounterDirectives to clean up StyleBuilder and RenderCounter.
Attachments
Patch (21.18 KB, patch)
2012-08-21 04:27 PDT, Elliott Sprehn
no flags
Patch for landing (23.27 KB, patch)
2012-09-06 18:36 PDT, Elliott Sprehn
no flags
Elliott Sprehn
Comment 1 2012-08-21 04:27:48 PDT
Julien Chaffraix
Comment 2 2012-08-21 15:53:13 PDT
Comment on attachment 159653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=159653&action=review > Source/WebCore/rendering/style/CounterDirectives.h:40 > : m_reset(false) > , m_increment(false) This naming should be improved while we are touching this code. Some better names: * m_isResetCounter / m_hasCounterResetSet * m_isIncrementCounter / m_hasCounterIncrementSet > Source/WebCore/rendering/style/CounterDirectives.h:86 > + int value() const This value name is dangerous as you have lost the information whether you actually reset. I would have anticipated that value would return something I could just add to the current value. Maybe valueForResetOrIncrement would better convey this idea.
Elliott Sprehn
Comment 3 2012-09-06 18:10:26 PDT
This fixes 94642 because it's more careful about initializing the values.
Elliott Sprehn
Comment 4 2012-09-06 18:25:58 PDT
(In reply to comment #2) > (From update of attachment 159653 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=159653&action=review > ... > > > Source/WebCore/rendering/style/CounterDirectives.h:86 > > + int value() const > > This value name is dangerous as you have lost the information whether you actually reset. I would have anticipated that value would return something I could just add to the current value. > > Maybe valueForResetOrIncrement would better convey this idea. Indeed it is something you can just add to the "current value", the catch being that on a reset CounterNode the current value is 0, while on other nodes the current value is the value of our ancestor node. I changed this to combinedValue(). Overall it would be nice to get rid of CounterDirectives entirely, it's a confusing container for what should just be two maps and RenderStyle should have something like getCounterReset(String& identifier) and getCounterIncrement(String& identifier) that return a struct CounterValue() { bool isDefined(); int value(); } or something like that that.
Elliott Sprehn
Comment 5 2012-09-06 18:36:52 PDT
Created attachment 162643 [details] Patch for landing
WebKit Review Bot
Comment 6 2012-09-06 22:21:47 PDT
Comment on attachment 162643 [details] Patch for landing Clearing flags on attachment: 162643 Committed r127826: <http://trac.webkit.org/changeset/127826>
WebKit Review Bot
Comment 7 2012-09-06 22:21:51 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.