Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 61d1950d3bd4e746a42c278da6c53ef5ac9af4f3
      
https://github.com/WebKit/WebKit/commit/61d1950d3bd4e746a42c278da6c53ef5ac9af4f3
  Author: Darin Adler <[email protected]>
  Date:   2022-11-05 (Sat, 05 Nov 2022)

  Changed paths:
    M Source/WTF/wtf/FixedVector.h
    M Source/WTF/wtf/Vector.h
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/css/makeprop.pl
    M Source/WebCore/css/makevalues.pl
    M Source/WebCore/dom/Document.cpp

  Log Message:
  -----------
  Make the further refinements to CSS property and value code suggested in the 
review of 256223@main
https://bugs.webkit.org/show_bug.cgi?id=247495
rdar://problem/101967609

Reviewed by Sam Weinig.

* Source/WTF/wtf/FixedVector.h: Added constructor that takes two input 
iterators.

* Source/WTF/wtf/Vector.h:
(WTF::Mapper::map): Use rvalue reference in the for loop so we can work with 
iterators that don't
return actual references: makes sense anyway since we use WTFMove. Also 
corrected the argument type
in the helper for compactMap to match what's used in map to avoid an unneeded 
copy.
(WTF::CompactMapper::compactMap): Ditto.

* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::operator<<): Added overload for CSSPropertyID, and use it to simplify 
logging code below.

* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::copyProperties): Use compactMap here instead 
of
reserveInitialCapacity, append, and shrinkToFit.

* Source/WebCore/css/makeprop.pl: Remove unneeded backslashes. Added == member 
to the range iterator
and size member to the range itself. Added enough specialization of 
std::iterator_traits to make
compactMap work with the range.
* Source/WebCore/css/makevalues.pl: Ditto.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::exposedComputedCSSPropertyIDs): Use emplace and FixedVector 
constructor that
takes input iterators instead of first allocating a FixedVector and then 
calling std::copy.

Canonical link: https://commits.webkit.org/256368@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to