Commit ac7170cd authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Remove using directives ("using namespace x") from blink/renderer/core/css/.

Bug: 82078
Change-Id: Icd953a0dfdcfd6c6b16b1606735f1f029dd734cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1873278
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708536}
parent 5df56b42
......@@ -30,7 +30,7 @@ class MakeMediaFeaturesWriter(json5_generator.Writer):
self._template_context = {
'entries': self.json5_file.name_dictionaries,
'input_files': self._input_files,
'header_guard': self.make_header_guard(self._relative_output_dir + 'media_festures.h')
'header_guard': self.make_header_guard(self._relative_output_dir + 'media_features.h')
}
@template_expander.use_jinja('core/css/templates/media_features.h.tmpl', filters=filters)
......
......@@ -10,7 +10,7 @@
{% for entry in entries %}
{% set constant_prefix = entry | symbol %}
{% set method_prefix = constant_prefix | to_function_name %}
macro({{constant_prefix}}, {{method_prefix}}){% if not loop.last %} \
macro(media_feature_names::{{constant_prefix}}, {{method_prefix}}){% if not loop.last %} \
{% endif %}
{% endfor %}
......
......@@ -16,8 +16,6 @@
namespace blink {
using namespace html_names;
class AffectedByPseudoTest : public PageTestBase {
protected:
struct ElementResult {
......@@ -57,11 +55,11 @@ void AffectedByPseudoTest::CheckElementsForFocus(
// ":focus div" will mark ascendants of all divs with
// childrenOrSiblingsAffectedByFocus.
TEST_F(AffectedByPseudoTest, FocusedAscendant) {
ElementResult expected[] = {{kBodyTag, true},
{kDivTag, true},
{kDivTag, false},
{kDivTag, false},
{kSpanTag, false}};
ElementResult expected[] = {{html_names::kBodyTag, true},
{html_names::kDivTag, true},
{html_names::kDivTag, false},
{html_names::kDivTag, false},
{html_names::kSpanTag, false}};
SetHtmlInnerHTML(R"HTML(
<head>
......@@ -79,11 +77,11 @@ TEST_F(AffectedByPseudoTest, FocusedAscendant) {
// "body:focus div" will mark the body element with
// childrenOrSiblingsAffectedByFocus.
TEST_F(AffectedByPseudoTest, FocusedAscendantWithType) {
ElementResult expected[] = {{kBodyTag, true},
{kDivTag, false},
{kDivTag, false},
{kDivTag, false},
{kSpanTag, false}};
ElementResult expected[] = {{html_names::kBodyTag, true},
{html_names::kDivTag, false},
{html_names::kDivTag, false},
{html_names::kDivTag, false},
{html_names::kSpanTag, false}};
SetHtmlInnerHTML(R"HTML(
<head>
......@@ -104,11 +102,11 @@ TEST_F(AffectedByPseudoTest, FocusedAscendantWithType) {
// is checked and the childrenOrSiblingsAffectedByFocus flag set before the
// negated type selector is found.
TEST_F(AffectedByPseudoTest, FocusedAscendantWithNegatedType) {
ElementResult expected[] = {{kBodyTag, false},
{kDivTag, true},
{kDivTag, false},
{kDivTag, false},
{kSpanTag, false}};
ElementResult expected[] = {{html_names::kBodyTag, false},
{html_names::kDivTag, true},
{html_names::kDivTag, false},
{html_names::kDivTag, false},
{html_names::kSpanTag, false}};
SetHtmlInnerHTML(R"HTML(
<head>
......@@ -130,8 +128,10 @@ TEST_F(AffectedByPseudoTest, FocusedAscendantWithNegatedType) {
// though none of the children are affected. There are other mechanisms that
// makes sure the sibling also gets its styles recalculated.
TEST_F(AffectedByPseudoTest, FocusedSibling) {
ElementResult expected[] = {
{kBodyTag, false}, {kDivTag, true}, {kSpanTag, false}, {kDivTag, false}};
ElementResult expected[] = {{html_names::kBodyTag, false},
{html_names::kDivTag, true},
{html_names::kSpanTag, false},
{html_names::kDivTag, false}};
SetHtmlInnerHTML(R"HTML(
<head>
......
......@@ -12,10 +12,8 @@
namespace blink {
using namespace css_test_helpers;
TEST(CSSPageRule, Serializing) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
const char* css_rule = "@page :left { size: auto; }";
sheet.AddCSSRules(css_rule);
......@@ -29,7 +27,7 @@ TEST(CSSPageRule, Serializing) {
}
TEST(CSSPageRule, selectorText) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
const char* css_rule = "@page :left { size: auto; }";
sheet.AddCSSRules(css_rule);
......
......@@ -11,11 +11,10 @@
namespace blink {
namespace {
using namespace cssvalue;
using Type = CSSPendingInterpolationValue::Type;
using Type = cssvalue::CSSPendingInterpolationValue::Type;
CSSPendingInterpolationValue* Create(Type type) {
return CSSPendingInterpolationValue::Create(type);
cssvalue::CSSPendingInterpolationValue* Create(Type type) {
return cssvalue::CSSPendingInterpolationValue::Create(type);
}
TEST(CSSPendingInterpolationValueTest, Create) {
......
......@@ -9,10 +9,8 @@
namespace blink {
using namespace css_test_helpers;
TEST(CSSSelector, Representations) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
const char* css_rules =
"summary::-webkit-details-marker { }"
......
......@@ -12,10 +12,8 @@
namespace blink {
using namespace css_test_helpers;
TEST(CSSStyleDeclarationTest, getPropertyShorthand) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("div { padding: var(--p); }");
ASSERT_TRUE(sheet.CssRules());
......
......@@ -51,8 +51,6 @@
namespace blink {
using namespace html_names;
class StyleSheetCSSRuleList final : public CSSRuleList {
public:
StyleSheetCSSRuleList(CSSStyleSheet* sheet) : style_sheet_(sheet) {}
......@@ -587,8 +585,8 @@ void CSSStyleSheet::SetAlternateFromConstructor(
bool CSSStyleSheet::IsAlternate() const {
if (owner_node_) {
auto* owner_element = DynamicTo<Element>(owner_node_.Get());
return owner_element &&
owner_element->getAttribute(kRelAttr).Contains("alternate");
return owner_element && owner_element->getAttribute(html_names::kRelAttr)
.Contains("alternate");
}
return alternate_from_constructor_;
}
......
......@@ -43,8 +43,6 @@ bool CouldConsumeReservedKeyword(CSSParserTokenRange range) {
const CSSValue* ConsumeSingleType(const CSSSyntaxComponent& syntax,
CSSParserTokenRange& range,
const CSSParserContext* context) {
using namespace css_property_parser_helpers;
switch (syntax.GetType()) {
case CSSSyntaxType::kIdent:
if (range.Peek().GetType() == kIdentToken &&
......@@ -55,39 +53,45 @@ const CSSValue* ConsumeSingleType(const CSSSyntaxComponent& syntax,
}
return nullptr;
case CSSSyntaxType::kLength:
return ConsumeLength(range, kHTMLStandardMode,
ValueRange::kValueRangeAll);
return css_property_parser_helpers::ConsumeLength(
range, kHTMLStandardMode, ValueRange::kValueRangeAll);
case CSSSyntaxType::kNumber:
return ConsumeNumber(range, ValueRange::kValueRangeAll);
return css_property_parser_helpers::ConsumeNumber(
range, ValueRange::kValueRangeAll);
case CSSSyntaxType::kPercentage:
return ConsumePercent(range, ValueRange::kValueRangeAll);
return css_property_parser_helpers::ConsumePercent(
range, ValueRange::kValueRangeAll);
case CSSSyntaxType::kLengthPercentage:
return ConsumeLengthOrPercent(range, kHTMLStandardMode,
ValueRange::kValueRangeAll);
return css_property_parser_helpers::ConsumeLengthOrPercent(
range, kHTMLStandardMode, ValueRange::kValueRangeAll);
case CSSSyntaxType::kColor:
return ConsumeColor(range, kHTMLStandardMode);
return css_property_parser_helpers::ConsumeColor(range,
kHTMLStandardMode);
case CSSSyntaxType::kImage:
return ConsumeImage(range, context);
return css_property_parser_helpers::ConsumeImage(range, context);
case CSSSyntaxType::kUrl:
return ConsumeUrl(range, context);
return css_property_parser_helpers::ConsumeUrl(range, context);
case CSSSyntaxType::kInteger:
return ConsumeIntegerOrNumberCalc(range);
return css_property_parser_helpers::ConsumeIntegerOrNumberCalc(range);
case CSSSyntaxType::kAngle:
return ConsumeAngle(range, context, base::Optional<WebFeature>());
return css_property_parser_helpers::ConsumeAngle(
range, context, base::Optional<WebFeature>());
case CSSSyntaxType::kTime:
return ConsumeTime(range, ValueRange::kValueRangeAll);
return css_property_parser_helpers::ConsumeTime(
range, ValueRange::kValueRangeAll);
case CSSSyntaxType::kResolution:
return ConsumeResolution(range);
return css_property_parser_helpers::ConsumeResolution(range);
case CSSSyntaxType::kTransformFunction:
return ConsumeTransformValue(range, *context);
return css_property_parser_helpers::ConsumeTransformValue(range,
*context);
case CSSSyntaxType::kTransformList:
return ConsumeTransformList(range, *context);
return css_property_parser_helpers::ConsumeTransformList(range, *context);
case CSSSyntaxType::kCustomIdent:
// TODO(crbug.com/579788): Implement 'revert'.
// TODO(crbug.com/882285): Make 'default' invalid as <custom-ident>.
if (IsReservedIdentToken(range.Peek()))
return nullptr;
return ConsumeCustomIdent(range, *context);
return css_property_parser_helpers::ConsumeCustomIdent(range, *context);
default:
NOTREACHED();
return nullptr;
......
......@@ -11,20 +11,19 @@
namespace blink {
namespace {
using namespace cssvalue;
TEST(CSSURIValueTest, ValueWithURLMadeAbsolute) {
CSSURIValue* rel = CSSURIValue::Create("a", KURL("http://foo.com/a"));
CSSURIValue* abs = rel->ValueWithURLMadeAbsolute(KURL("http://bar.com"),
WTF::TextEncoding());
cssvalue::CSSURIValue* rel =
cssvalue::CSSURIValue::Create("a", KURL("http://foo.com/a"));
cssvalue::CSSURIValue* abs = rel->ValueWithURLMadeAbsolute(
KURL("http://bar.com"), WTF::TextEncoding());
EXPECT_EQ("url(\"http://bar.com/a\")", abs->CssText());
}
TEST(CSSURIValueTest, AlreadyAbsoluteURLMadeAbsolute) {
CSSURIValue* rel =
CSSURIValue::Create("http://baz.com/a", KURL("http://baz.com/a"));
CSSURIValue* abs = rel->ValueWithURLMadeAbsolute(KURL("http://bar.com"),
WTF::TextEncoding());
cssvalue::CSSURIValue* rel = cssvalue::CSSURIValue::Create(
"http://baz.com/a", KURL("http://baz.com/a"));
cssvalue::CSSURIValue* abs = rel->ValueWithURLMadeAbsolute(
KURL("http://bar.com"), WTF::TextEncoding());
EXPECT_EQ("url(\"http://baz.com/a\")", abs->CssText());
}
......
......@@ -30,8 +30,6 @@
namespace blink {
using namespace cssvalue;
CSSValuePool& CssValuePool() {
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<Persistent<CSSValuePool>>,
thread_specific_pool, ());
......@@ -49,12 +47,14 @@ CSSValuePool::CSSValuePool()
unset_value_(MakeGarbageCollected<CSSUnsetValue>(PassKey())),
invalid_variable_value_(MakeGarbageCollected<CSSInvalidVariableValue>()),
color_transparent_(
MakeGarbageCollected<CSSColorValue>(Color::kTransparent)),
color_white_(MakeGarbageCollected<CSSColorValue>(Color::kWhite)),
color_black_(MakeGarbageCollected<CSSColorValue>(Color::kBlack)) {
MakeGarbageCollected<cssvalue::CSSColorValue>(Color::kTransparent)),
color_white_(
MakeGarbageCollected<cssvalue::CSSColorValue>(Color::kWhite)),
color_black_(
MakeGarbageCollected<cssvalue::CSSColorValue>(Color::kBlack)) {
{
using Value = CSSPendingInterpolationValue;
using Type = CSSPendingInterpolationValue::Type;
using Value = cssvalue::CSSPendingInterpolationValue;
using Type = cssvalue::CSSPendingInterpolationValue::Type;
pending_interpolation_values_[0] =
MakeGarbageCollected<Value>(Type::kCSSProperty);
pending_interpolation_values_[1] =
......
......@@ -20,8 +20,6 @@
namespace blink {
using namespace cssvalue;
class FontFaceCacheTest : public PageTestBase {
USING_FAST_MALLOC(FontFaceCacheTest);
......@@ -459,7 +457,7 @@ TEST_F(FontFaceCacheTest, ObliqueRangeMatching) {
CSSNumericLiteralValue::Create(35, CSSPrimitiveValue::UnitType::kNumber);
oblique_range->Append(*oblique_from);
oblique_range->Append(*oblique_to);
auto* oblique_value = MakeGarbageCollected<CSSFontStyleRangeValue>(
auto* oblique_value = MakeGarbageCollected<cssvalue::CSSFontStyleRangeValue>(
*oblique_keyword_value, *oblique_range);
AppendTestFaceForCapabilities(*stretch_value, *oblique_value, *weight_value);
......@@ -471,8 +469,9 @@ TEST_F(FontFaceCacheTest, ObliqueRangeMatching) {
CSSNumericLiteralValue::Create(10, CSSPrimitiveValue::UnitType::kNumber);
oblique_range_second->Append(*oblique_from_second);
oblique_range_second->Append(*oblique_to_second);
auto* oblique_value_second = MakeGarbageCollected<CSSFontStyleRangeValue>(
*oblique_keyword_value, *oblique_range_second);
auto* oblique_value_second =
MakeGarbageCollected<cssvalue::CSSFontStyleRangeValue>(
*oblique_keyword_value, *oblique_range_second);
AppendTestFaceForCapabilities(*stretch_value, *oblique_value_second,
*weight_value);
......
......@@ -59,8 +59,6 @@
namespace blink {
using namespace media_feature_names;
enum MediaFeaturePrefix { kMinPrefix, kMaxPrefix, kNoPrefix };
using EvalFunc = bool (*)(const MediaQueryExpValue&,
......
......@@ -35,12 +35,10 @@
namespace blink {
using namespace css_test_helpers;
namespace {
StyleRule* CreateDummyStyleRule() {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("#id { color: tomato; }");
const RuleSet& rule_set = sheet.GetRuleSet();
const HeapVector<Member<const RuleData>>* rules = rule_set.IdRules("id");
......@@ -51,7 +49,7 @@ StyleRule* CreateDummyStyleRule() {
} // namespace
TEST(RuleSetTest, findBestRuleSetAndAdd_CustomPseudoElements) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("summary::-webkit-details-marker { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -63,7 +61,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_CustomPseudoElements) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_Id) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("#id { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -74,7 +72,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_Id) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_NthChild) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("div:nth-child(2) { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -85,7 +83,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_NthChild) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_ClassThenId) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(".class#id { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -98,7 +96,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_ClassThenId) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_IdThenClass) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("#id.class { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -109,7 +107,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_IdThenClass) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_AttrThenId) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("[attr]#id { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -121,7 +119,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_AttrThenId) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_TagThenAttrThenId) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("div[attr]#id { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -133,7 +131,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_TagThenAttrThenId) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_DivWithContent) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("div::content { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -145,7 +143,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_DivWithContent) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_Host) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(":host { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -154,7 +152,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_Host) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_HostWithId) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(":host(#x) { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -163,7 +161,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_HostWithId) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_HostContext) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(":host-context(*) { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -172,7 +170,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_HostContext) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_HostContextWithId) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(":host-context(#x) { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -181,7 +179,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_HostContextWithId) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_HostAndHostContextNotInRightmost) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(":host-context(#x) .y, :host(.a) > #b { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -196,7 +194,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_HostAndHostContextNotInRightmost) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_HostAndClass) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(".foo:host { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -205,7 +203,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_HostAndClass) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_HostContextAndClass) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(".foo:host-context(*) { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -214,7 +212,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_HostContextAndClass) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_Focus) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(":focus { }");
sheet.AddCSSRules("[attr]:focus { }");
......@@ -225,7 +223,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_Focus) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_LinkVisited) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(":link { }");
sheet.AddCSSRules("[attr]:link { }");
......@@ -240,7 +238,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_LinkVisited) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_Cue) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("::cue(b) { }");
sheet.AddCSSRules("video::cue(u) { }");
......@@ -250,7 +248,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_Cue) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_PlaceholderPseudo) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules("::placeholder { }");
sheet.AddCSSRules("input::placeholder { }");
......@@ -260,7 +258,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_PlaceholderPseudo) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoIs) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(".a :is(.b+.c, .d>:is(.e, .f)) { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -285,7 +283,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoIs) {
}
TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoWhere) {
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(".a :where(.b+.c, .d>:where(.e, .f)) { }");
RuleSet& rule_set = sheet.GetRuleSet();
......@@ -312,7 +310,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoWhere) {
TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoIsTooLarge) {
// RuleData cannot support selectors at index 8192 or beyond so the expansion
// is limited to this size
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(
":is(.a#a, .b#b, .c#c, .d#d) + "
......@@ -330,7 +328,7 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoIsTooLarge) {
TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoWhereTooLarge) {
// RuleData cannot support selectors at index 8192 or beyond so the expansion
// is limited to this size
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(
":where(.a#a, .b#b, .c#c, .d#d) + :where(.e#e, .f#f, .g#g, .h#h) + "
......@@ -360,7 +358,7 @@ TEST(RuleSetTest, SelectorIndexLimit) {
builder.Append("b,span {}");
TestStyleSheet sheet;
css_test_helpers::TestStyleSheet sheet;
sheet.AddCSSRules(builder.ToString());
const RuleSet& rule_set = sheet.GetRuleSet();
const HeapVector<Member<const RuleData>>* rules = rule_set.TagRules("b");
......
......@@ -47,8 +47,6 @@
namespace blink {
using namespace html_names;
#if DCHECK_IS_ON() || defined(RELEASE_QUERY_STATS)
static SelectorQuery::QueryStats& CurrentQueryStats() {
DEFINE_STATIC_LOCAL(SelectorQuery::QueryStats, stats, ());
......@@ -505,7 +503,7 @@ SelectorQuery::SelectorQuery(CSSSelectorList selector_list)
// We only use the fast path when in standards mode where #id selectors
// are case sensitive, so we need the same behavior for [id=value].
if (current->Match() == CSSSelector::kAttributeExact &&
current->Attribute() == kIdAttr &&
current->Attribute() == html_names::kIdAttr &&
current->AttributeMatch() == CSSSelector::kCaseSensitive) {
selector_id_ = current->Value();
break;
......
......@@ -44,8 +44,6 @@
namespace blink {
using namespace css_test_helpers;
class StyleEngineTest : public testing::Test {
protected:
void SetUp() override;
......@@ -1947,7 +1945,8 @@ TEST_F(StyleEngineTest, InitialDataCreation) {
EXPECT_FALSE(GetStyleEngine().MaybeCreateAndGetInitialData());
// After registering, there should be initial data.
RegisterProperty(GetDocument(), "--x", "<length>", "10px", false);
css_test_helpers::RegisterProperty(GetDocument(), "--x", "<length>", "10px",
false);
auto data1 = GetStyleEngine().MaybeCreateAndGetInitialData();
EXPECT_TRUE(data1);
......@@ -1963,7 +1962,8 @@ TEST_F(StyleEngineTest, InitialDataCreation) {
// After registering a new property, initial data should be invalidated,
// such that the new initial data is different.
RegisterProperty(GetDocument(), "--y", "<color>", "black", false);
css_test_helpers::RegisterProperty(GetDocument(), "--y", "<color>", "black",
false);
EXPECT_NE(data1, GetStyleEngine().MaybeCreateAndGetInitialData());
}
......
......@@ -41,8 +41,6 @@
namespace blink {
using namespace cssvalue;
StylePropertySerializer::CSSPropertyValueSetForSerializer::
CSSPropertyValueSetForSerializer(const CSSPropertyValueSet& properties)
: property_set_(&properties),
......@@ -387,7 +385,7 @@ String StylePropertySerializer::CommonShorthandChecks(
}
if (success) {
if (const auto* substitution_value =
DynamicTo<CSSPendingSubstitutionValue>(longhands[0])) {
DynamicTo<cssvalue::CSSPendingSubstitutionValue>(longhands[0])) {
if (substitution_value->ShorthandPropertyId() != shorthand.id())
return g_empty_string;
return substitution_value->ShorthandValue()->CssText();
......
......@@ -37,11 +37,10 @@
namespace blink {
using namespace html_names;
AtomicString StyleSheetCandidate::Title() const {
return IsElement() ? To<Element>(GetNode()).FastGetAttribute(kTitleAttr)
: g_null_atom;
return IsElement()
? To<Element>(GetNode()).FastGetAttribute(html_names::kTitleAttr)
: g_null_atom;
}
bool StyleSheetCandidate::IsXSL() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment