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

Remove using directives ("using namespace x") in renderer/core/html/media/.

Bug: 82078
Change-Id: Ia44c6badc61728a483203809df4f4d4153a42d23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1871289
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707833}
parent 02be9723
......@@ -30,10 +30,8 @@
namespace blink {
using namespace html_names;
HTMLAudioElement::HTMLAudioElement(Document& document)
: HTMLMediaElement(kAudioTag, document) {
: HTMLMediaElement(html_names::kAudioTag, document) {
EnsureUserAgentShadowRoot();
UpdateStateIfNeeded();
}
......
......@@ -65,8 +65,6 @@
namespace blink {
using namespace html_names;
namespace {
constexpr float kMostlyFillViewportThreshold = 0.85f;
......@@ -81,7 +79,7 @@ enum VideoPersistenceControlsType {
} // anonymous namespace
HTMLVideoElement::HTMLVideoElement(Document& document)
: HTMLMediaElement(kVideoTag, document),
: HTMLMediaElement(html_names::kVideoTag, document),
remoting_interstitial_(nullptr),
picture_in_picture_interstitial_(nullptr),
in_overlay_fullscreen_video_(false) {
......@@ -176,9 +174,9 @@ void HTMLVideoElement::CollectStyleForPresentationAttribute(
const QualifiedName& name,
const AtomicString& value,
MutableCSSPropertyValueSet* style) {
if (name == kWidthAttr)
if (name == html_names::kWidthAttr)
AddHTMLLengthToStyle(style, CSSPropertyID::kWidth, value);
else if (name == kHeightAttr)
else if (name == html_names::kHeightAttr)
AddHTMLLengthToStyle(style, CSSPropertyID::kHeight, value);
else
HTMLMediaElement::CollectStyleForPresentationAttribute(name, value, style);
......@@ -186,14 +184,14 @@ void HTMLVideoElement::CollectStyleForPresentationAttribute(
bool HTMLVideoElement::IsPresentationAttribute(
const QualifiedName& name) const {
if (name == kWidthAttr || name == kHeightAttr)
if (name == html_names::kWidthAttr || name == html_names::kHeightAttr)
return true;
return HTMLMediaElement::IsPresentationAttribute(name);
}
void HTMLVideoElement::ParseAttribute(
const AttributeModificationParams& params) {
if (params.name == kPosterAttr) {
if (params.name == html_names::kPosterAttr) {
// In case the poster attribute is set after playback, don't update the
// display state, post playback the correct state will be picked up.
if (GetDisplayMode() < kVideo || !HasAvailableVideoFrame()) {
......@@ -223,7 +221,7 @@ void HTMLVideoElement::ParseAttribute(
remoting_interstitial_->OnPosterImageChanged();
if (picture_in_picture_interstitial_)
picture_in_picture_interstitial_->OnPosterImageChanged();
} else if (params.name == kAutopictureinpictureAttr &&
} else if (params.name == html_names::kAutopictureinpictureAttr &&
RuntimeEnabledFeatures::AutoPictureInPictureEnabled(
GetExecutionContext())) {
if (!params.new_value.IsNull()) {
......@@ -264,12 +262,12 @@ IntSize HTMLVideoElement::GetOverriddenIntrinsicSize() const {
}
bool HTMLVideoElement::IsURLAttribute(const Attribute& attribute) const {
return attribute.GetName() == kPosterAttr ||
return attribute.GetName() == html_names::kPosterAttr ||
HTMLMediaElement::IsURLAttribute(attribute);
}
const AtomicString HTMLVideoElement::ImageSourceURL() const {
const AtomicString& url = getAttribute(kPosterAttr);
const AtomicString& url = getAttribute(html_names::kPosterAttr);
if (!StripLeadingAndTrailingHTMLSpaces(url).IsEmpty())
return url;
return default_poster_url_;
......
......@@ -53,8 +53,6 @@
namespace blink {
using namespace html_names;
class MediaDocumentParser : public RawDataDocumentParser {
public:
explicit MediaDocumentParser(Document* document)
......@@ -88,17 +86,18 @@ void MediaDocumentParser::CreateDocumentStructure() {
auto* head = MakeGarbageCollected<HTMLHeadElement>(*GetDocument());
auto* meta = MakeGarbageCollected<HTMLMetaElement>(*GetDocument());
meta->setAttribute(kNameAttr, "viewport");
meta->setAttribute(kContentAttr, "width=device-width");
meta->setAttribute(html_names::kNameAttr, "viewport");
meta->setAttribute(html_names::kContentAttr, "width=device-width");
head->AppendChild(meta);
auto* media = MakeGarbageCollected<HTMLVideoElement>(*GetDocument());
media->setAttribute(kControlsAttr, "");
media->setAttribute(kAutoplayAttr, "");
media->setAttribute(kNameAttr, "media");
media->setAttribute(html_names::kControlsAttr, "");
media->setAttribute(html_names::kAutoplayAttr, "");
media->setAttribute(html_names::kNameAttr, "media");
auto* source = MakeGarbageCollected<HTMLSourceElement>(*GetDocument());
source->setAttribute(kSrcAttr, AtomicString(GetDocument()->Url()));
source->setAttribute(html_names::kSrcAttr,
AtomicString(GetDocument()->Url()));
if (DocumentLoader* loader = GetDocument()->Loader())
source->setType(loader->MimeType());
......
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