| // Copyright 2018 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 "core/css/properties/shorthands/GridColumnGap.h" |
| |
| #include "core/StylePropertyShorthand.h" |
| #include "core/css/parser/CSSPropertyParserHelpers.h" |
| #include "core/css/properties/CSSParsingUtils.h" |
| #include "core/css/properties/ComputedStyleUtils.h" |
| |
| namespace blink { |
| namespace CSSShorthand { |
| |
| bool GridColumnGap::ParseShorthand( |
| bool important, |
| CSSParserTokenRange& range, |
| const CSSParserContext& context, |
| const CSSParserLocalContext&, |
| HeapVector<CSSPropertyValue, 256>& properties) const { |
| CSSValue* gap_length = CSSParsingUtils::ConsumeGapLength(range, context); |
| if (!gap_length || !range.AtEnd()) |
| return false; |
| |
| CSSPropertyParserHelpers::AddProperty( |
| CSSPropertyColumnGap, CSSPropertyGridColumnGap, *gap_length, important, |
| CSSPropertyParserHelpers::IsImplicitProperty::kNotImplicit, properties); |
| return true; |
| } |
| |
| const CSSValue* GridColumnGap::CSSValueFromComputedStyleInternal( |
| const ComputedStyle& style, |
| const SVGComputedStyle&, |
| const LayoutObject* layout_object, |
| Node* styled_node, |
| bool allow_visited_style) const { |
| return ComputedStyleUtils::ValuesForShorthandProperty( |
| gridColumnGapShorthand(), style, layout_object, styled_node, |
| allow_visited_style); |
| } |
| |
| } // namespace CSSShorthand |
| } // namespace blink |