blob: 9122c3283a0ebd4df4bd23eeb49b7b0c05410976 [file] [log] [blame]
// 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/GridRowGap.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 GridRowGap::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(
CSSPropertyRowGap, CSSPropertyGridRowGap, *gap_length, important,
CSSPropertyParserHelpers::IsImplicitProperty::kNotImplicit, properties);
return true;
}
const CSSValue* GridRowGap::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
gridRowGapShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand
} // namespace blink