Element::rareData()/Element::ensureRareData() and Node::rareData()/Node::ensureRareData() are confusing. They are not virtual methods. For clarification, we can rename Element::rareData() to Element::elementRareData(), and Element::ensureRareData() to Element::ensureElementRareData(). c.f. SVGRareData uses SVGElement::rareSVGData() and SVGElement::ensureRareSVGData(). (We might want to rename them to SVGElement::svgRareData() and SVGElement::ensureSVGRareData() though.)
Created attachment 149690 [details] Patch
Is that confusing? How could you misuse it? Another random idea is to unify then to rareData(bool ensure);
(In reply to comment #2) > Is that confusing? How could you misuse it? Misuse would lead to a compile error (because Node::rareData() returns NodeRareData and Element::rareData() returns ElementRareData), and thus it would not cause any serious issue in consequence. That being said, distinguishing their names would be less confusing. For example, SVGElement uses rareSVGData() to retrieve SVGRareData (I am trying to rename it to svgRareData() though). Specific context: I've tried to virtualize Node::rareData() to cache NodeRareData* on Document to optimize Dromaeo. Then Element::rareData() prevented me from doing the virtualization. (Whether the optimization is acceptable or not is another topic.)
(In reply to comment #3) > Specific context: I've tried to virtualize Node::rareData() to cache NodeRareData* on Document to optimize Dromaeo. Then Element::rareData() prevented me from doing the virtualization. (Whether the optimization is acceptable or not is another topic.) I don't think we want to virtualize rareData(). That function is already slow. We shouldn't be making it even slower by virtualizing it.
Comment on attachment 149690 [details] Patch Regardless, this sounds like a good idea.
morrita-san: If you think the change is OK, I'm happy to commit it.
Comment on attachment 149690 [details] Patch Clearing flags on attachment: 149690 Committed r121335: <http://trac.webkit.org/changeset/121335>
All reviewed patches have been landed. Closing bug.