text: // Copyright 2017 The Chromium Authors. All rights reserved.
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  
  #include "third_party/blink/renderer/core/css/properties/longhands/webkit_mask_clip.h"
  
  #include "third_party/blink/renderer/core/css/parser/css_parser_context.h"
  #include "third_party/blink/renderer/core/css/parser/css_property_parser_helpers.h"
  #include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h"
  #include "third_party/blink/renderer/core/style/computed_style.h"
  
  namespace blink {
  namespace CSSLonghand {
  
  const CSSValue* WebkitMaskClip::ParseSingleValue(
      CSSParserTokenRange& range,
      const CSSParserContext&,
      const CSSParserLocalContext&) const {
    return CSSPropertyParserHelpers::ConsumeCommaSeparatedList(
        CSSParsingUtils::ConsumePrefixedBackgroundBox, range,
        CSSParsingUtils::AllowTextValue::kAllow);
  }
  
  const CSSValue* WebkitMaskClip::CSSValueFromComputedStyleInternal(
      const ComputedStyle& style,
      const SVGComputedStyle&,
      const LayoutObject*,
      Node*,
      bool allow_visited_style) const {
    CSSValueList* list = CSSValueList::CreateCommaSeparated();
    const FillLayer* curr_layer = &style.MaskLayers();
    for (; curr_layer; curr_layer = curr_layer->Next()) {
      EFillBox box = curr_layer->Clip();
      list->Append(*CSSIdentifierValue::Create(box));
    }
    return list;
  }
  
  }  // namespace CSSLonghand
  }  // namespace blink
  