Changeset 250914 in webkit


Ignore:
Timestamp:
Oct 9, 2019 9:45:00 AM (4 years ago)
Author:
Antti Koivisto
Message:

[CSS Shadow Parts] Minor exportparts attribute parsing cleanups
https://bugs.webkit.org/show_bug.cgi?id=202740

Reviewed by Zalan Bujtas.

  • dom/ShadowRoot.cpp:

(WebCore::parsePartMapping):
(WebCore::parsePartMappingsList):

Return the map as the return value.

(WebCore::ShadowRoot::partMappings const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r250913 r250914  
     12019-10-09  Antti Koivisto  <antti@apple.com>
     2
     3        [CSS Shadow Parts] Minor exportparts attribute parsing cleanups
     4        https://bugs.webkit.org/show_bug.cgi?id=202740
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * dom/ShadowRoot.cpp:
     9        (WebCore::parsePartMapping):
     10        (WebCore::parsePartMappingsList):
     11
     12        Return the map as the return value.
     13
     14        (WebCore::ShadowRoot::partMappings const):
     15
    1162019-10-09  Andy Estes  <aestes@apple.com>
    217
  • trunk/Source/WebCore/dom/ShadowRoot.cpp

    r250902 r250914  
    259259    const auto end = mappingString.length();
    260260
    261     auto skipWhitespace = [&] (auto position) {
     261    auto skipWhitespace = [&](auto position) {
    262262        while (position < end && isHTMLSpace(mappingString[position]))
    263263            ++position;
     
    265265    };
    266266
    267     auto collectValue = [&] (auto position) {
     267    auto collectValue = [&](auto position) {
    268268        while (position < end && (!isHTMLSpace(mappingString[position]) && mappingString[position] != ':'))
    269269            ++position;
     
    302302}
    303303
    304 static void parsePartMappingsList(ShadowRoot::PartMappings& mappings, StringView mappingsListString)
    305 {
     304static ShadowRoot::PartMappings parsePartMappingsList(StringView mappingsListString)
     305{
     306    if (!RuntimeEnabledFeatures::sharedFeatures().cssShadowPartsEnabled())
     307        return { };
     308
     309    ShadowRoot::PartMappings mappings;
     310
    306311    const auto end = mappingsListString.length();
    307312
     
    321326        begin = mappingEnd + 1;
    322327    }
     328
     329    return mappings;
    323330}
    324331
     
    326333{
    327334    if (!m_partMappings) {
    328         m_partMappings = PartMappings();
    329 
    330335        auto exportpartsValue = host()->attributeWithoutSynchronization(HTMLNames::exportpartsAttr);
    331         if (!exportpartsValue.isEmpty() && RuntimeEnabledFeatures::sharedFeatures().cssShadowPartsEnabled())
    332             parsePartMappingsList(*m_partMappings, exportpartsValue);
     336        m_partMappings = parsePartMappingsList(exportpartsValue);
    333337    }
    334338
Note: See TracChangeset for help on using the changeset viewer.