Move media controls subtree creation into one method.
Created attachment 86711 [details] Patch
Comment on attachment 86711 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=86711&action=review > Source/WebCore/rendering/MediaControlElements.cpp:800 > + setAttribute(precisionAttr, "float"); It’s not a great idea to call functional like this inside the constructor where the object still hasn’t been adopted by its first owner. It can lead to RefCounted assertions if anything ref/derefs. I took these out of the class intentionally a while back, and you are undoing that. The work should be either in a create function or at the call site rather than in the constructor. > Source/WebCore/rendering/MediaControlElements.cpp:864 > + setAttribute(precisionAttr, "float"); > + setAttribute(maxAttr, "1"); > + setAttribute(valueAttr, String::number(mediaElement->volume())); Ditto.
(In reply to comment #2) > (From update of attachment 86711 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=86711&action=review > > > Source/WebCore/rendering/MediaControlElements.cpp:800 > > + setAttribute(precisionAttr, "float"); > > It’s not a great idea to call functional like this inside the constructor where the object still hasn’t been adopted by its first owner. It can lead to RefCounted assertions if anything ref/derefs. I took these out of the class intentionally a while back, and you are undoing that. > > The work should be either in a create function or at the call site rather than in the constructor. > > > Source/WebCore/rendering/MediaControlElements.cpp:864 > > + setAttribute(precisionAttr, "float"); > > + setAttribute(maxAttr, "1"); > > + setAttribute(valueAttr, String::number(mediaElement->volume())); > > Ditto. Sure, I'll move these to create func.
Committed r81872: <http://trac.webkit.org/changeset/81872>