MutableStyleProperties::addParsedProperties() takes a const Vector<CSSProperty>& but m_parsedProperties is a Vector<CSSProperty, 256>, and apparently this forces a copy.
Very nice find :) We really supposed to use ParsedPropertyVector type here.
Created attachment 251171 [details] Patch
Comment on attachment 251171 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251171&action=review > Source/WebCore/css/CSSParser.h:84 > + using ParsedPropertyVector = Vector<CSSProperty, 256>; Does the compiler enforce a match between this and the typedef? > Source/WebCore/css/StyleProperties.cpp:770 > + for (auto& property : properties) const auto&?
Comment on attachment 251171 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251171&action=review >> Source/WebCore/css/CSSParser.h:84 >> + using ParsedPropertyVector = Vector<CSSProperty, 256>; > > Does the compiler enforce a match between this and the typedef? Which typedef? I just made the typedef public so it could be used in StyleProperties. I used a 'using' statement but it is equivalent to a typedef in this case. >> Source/WebCore/css/StyleProperties.cpp:770 >> + for (auto& property : properties) > > const auto&? auto will be a const CSSProperty so it is equivalent but OK.
Created attachment 251179 [details] Patch
To avoid mistakes like this in the future, I think we should make the following constructor explicit: template<size_t otherCapacity, typename otherOverflowBehaviour> Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&); I can look into this in a follow-up patch as it likely is a larger change.
Comment on attachment 251179 [details] Patch Clearing flags on attachment: 251179 Committed r183024: <http://trac.webkit.org/changeset/183024>
All reviewed patches have been landed. Closing bug.
(In reply to comment #6) > To avoid mistakes like this in the future, I think we should make the > following constructor explicit: > template<size_t otherCapacity, typename otherOverflowBehaviour> > Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&); > > I can look into this in a follow-up patch as it likely is a larger change. -> https://bugs.webkit.org/show_bug.cgi?id=143970