http://trac.webkit.org/r160182 caused a regression in which a form element starts with <form> but doesn't get closed with </form>.
rdar://problem/18525239
<rdar://problem/18525239>
Created attachment 243152 [details] Fixes the bug
Created attachment 243153 [details] Reverted the scheme changes
*** Bug 137337 has been marked as a duplicate of this bug. ***
Comment on attachment 243153 [details] Reverted the scheme changes View in context: https://bugs.webkit.org/attachment.cgi?id=243153&action=review > Source/WebCore/html/parser/HTMLConstructionSite.cpp:462 > + m_form = static_pointer_cast<HTMLFormElement>(element.release()); Can we use to<HTMLFormElement> instead?
Comment on attachment 243153 [details] Reverted the scheme changes View in context: https://bugs.webkit.org/attachment.cgi?id=243153&action=review >> Source/WebCore/html/parser/HTMLConstructionSite.cpp:462 >> + m_form = static_pointer_cast<HTMLFormElement>(element.release()); > > Can we use to<HTMLFormElement> instead? We ended up calling it downcast<> :) And if we use downcast, then we can get rid of the assertion above.
Comment on attachment 243153 [details] Reverted the scheme changes View in context: https://bugs.webkit.org/attachment.cgi?id=243153&action=review >>> Source/WebCore/html/parser/HTMLConstructionSite.cpp:462 >>> + m_form = static_pointer_cast<HTMLFormElement>(element.release()); >> >> Can we use to<HTMLFormElement> instead? > > We ended up calling it downcast<> :) > > And if we use downcast, then we can get rid of the assertion above. That’s funny, I can’t believe I forgot it was named downcast. Yes, we should use downcast here!
(In reply to comment #8) > Comment on attachment 243153 [details] > Reverted the scheme changes > > View in context: > https://bugs.webkit.org/attachment.cgi?id=243153&action=review > > >>> Source/WebCore/html/parser/HTMLConstructionSite.cpp:462 > >>> + m_form = static_pointer_cast<HTMLFormElement>(element.release()); > >> > >> Can we use to<HTMLFormElement> instead? > > > > We ended up calling it downcast<> :) > > > > And if we use downcast, then we can get rid of the assertion above. > > That’s funny, I can’t believe I forgot it was named downcast. Yes, we should > use downcast here! How do I use downcast here given element is a PassRefPtr?
Comment on attachment 243153 [details] Reverted the scheme changes View in context: https://bugs.webkit.org/attachment.cgi?id=243153&action=review >>>>> Source/WebCore/html/parser/HTMLConstructionSite.cpp:462 >>>>> + m_form = static_pointer_cast<HTMLFormElement>(element.release()); >>>> >>>> Can we use to<HTMLFormElement> instead? >>> >>> We ended up calling it downcast<> :) >>> >>> And if we use downcast, then we can get rid of the assertion above. >> >> That’s funny, I can’t believe I forgot it was named downcast. Yes, we should use downcast here! > > How do I use downcast here given element is a PassRefPtr? downcast<>() doesn't yet know of smart pointers. So right now, you would have to do: m_form = downcast<HTMLFormElement>(element.get()); Sadly this causes some ref-counting churn.
Comment on attachment 243153 [details] Reverted the scheme changes View in context: https://bugs.webkit.org/attachment.cgi?id=243153&action=review >>>>>> Source/WebCore/html/parser/HTMLConstructionSite.cpp:462 >>>>>> + m_form = static_pointer_cast<HTMLFormElement>(element.release()); >>>>> >>>>> Can we use to<HTMLFormElement> instead? >>>> >>>> We ended up calling it downcast<> :) >>>> >>>> And if we use downcast, then we can get rid of the assertion above. >>> >>> That’s funny, I can’t believe I forgot it was named downcast. Yes, we should use downcast here! >> >> How do I use downcast here given element is a PassRefPtr? > > downcast<>() doesn't yet know of smart pointers. So right now, you would have to do: > m_form = downcast<HTMLFormElement>(element.get()); > > Sadly this causes some ref-counting churn. The equivalent to static_pointer_cast<>() using downcast<>() right now would be: m_form = adoptRef(downcast<HTMLFormElement>(element.leakRef())); However, this isn't terribly readable.
Comment on attachment 243153 [details] Reverted the scheme changes I'm gonna commit this as is. We can't fix static_pointer_cast later when we support downcast for PassRefPtr.
Comment on attachment 243153 [details] Reverted the scheme changes Clearing flags on attachment: 243153 Committed r177263: <http://trac.webkit.org/changeset/177263>
All reviewed patches have been landed. Closing bug.