Commit 5fd4fd06 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

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

Bug: 82078
Change-Id: I4ccfdc803686da1842954cbf136fb3e33466f53d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1870047
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Fernando Serboncini <fserb@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708619}
parent 4089a5e1
...@@ -92,8 +92,6 @@ ...@@ -92,8 +92,6 @@
namespace blink { namespace blink {
using namespace html_names;
namespace { namespace {
// These values come from the WhatWG spec. // These values come from the WhatWG spec.
...@@ -109,7 +107,7 @@ constexpr int kMinimumAccelerated2dCanvasSize = 128 * 129; ...@@ -109,7 +107,7 @@ constexpr int kMinimumAccelerated2dCanvasSize = 128 * 129;
} // namespace } // namespace
HTMLCanvasElement::HTMLCanvasElement(Document& document) HTMLCanvasElement::HTMLCanvasElement(Document& document)
: HTMLElement(kCanvasTag, document), : HTMLElement(html_names::kCanvasTag, document),
ContextLifecycleObserver(&document), ContextLifecycleObserver(&document),
PageVisibilityObserver(document.GetPage()), PageVisibilityObserver(document.GetPage()),
CanvasRenderingContextHost( CanvasRenderingContextHost(
...@@ -171,7 +169,8 @@ void HTMLCanvasElement::Dispose() { ...@@ -171,7 +169,8 @@ void HTMLCanvasElement::Dispose() {
void HTMLCanvasElement::ParseAttribute( void HTMLCanvasElement::ParseAttribute(
const AttributeModificationParams& params) { const AttributeModificationParams& params) {
if (params.name == kWidthAttr || params.name == kHeightAttr) if (params.name == html_names::kWidthAttr ||
params.name == html_names::kHeightAttr)
Reset(); Reset();
HTMLElement::ParseAttribute(params); HTMLElement::ParseAttribute(params);
} }
...@@ -198,7 +197,8 @@ void HTMLCanvasElement::setHeight(unsigned value, ...@@ -198,7 +197,8 @@ void HTMLCanvasElement::setHeight(unsigned value,
"Cannot resize canvas after call to transferControlToOffscreen()."); "Cannot resize canvas after call to transferControlToOffscreen().");
return; return;
} }
SetUnsignedIntegralAttribute(kHeightAttr, value, kDefaultCanvasHeight); SetUnsignedIntegralAttribute(html_names::kHeightAttr, value,
kDefaultCanvasHeight);
} }
void HTMLCanvasElement::setWidth(unsigned value, void HTMLCanvasElement::setWidth(unsigned value,
...@@ -209,15 +209,16 @@ void HTMLCanvasElement::setWidth(unsigned value, ...@@ -209,15 +209,16 @@ void HTMLCanvasElement::setWidth(unsigned value,
"Cannot resize canvas after call to transferControlToOffscreen()."); "Cannot resize canvas after call to transferControlToOffscreen().");
return; return;
} }
SetUnsignedIntegralAttribute(kWidthAttr, value, kDefaultCanvasWidth); SetUnsignedIntegralAttribute(html_names::kWidthAttr, value,
kDefaultCanvasWidth);
} }
void HTMLCanvasElement::SetSize(const IntSize& new_size) { void HTMLCanvasElement::SetSize(const IntSize& new_size) {
if (new_size == Size()) if (new_size == Size())
return; return;
ignore_reset_ = true; ignore_reset_ = true;
SetIntegralAttribute(kWidthAttr, new_size.Width()); SetIntegralAttribute(html_names::kWidthAttr, new_size.Width());
SetIntegralAttribute(kHeightAttr, new_size.Height()); SetIntegralAttribute(html_names::kHeightAttr, new_size.Height());
ignore_reset_ = false; ignore_reset_ = false;
Reset(); Reset();
} }
...@@ -549,14 +550,14 @@ void HTMLCanvasElement::Reset() { ...@@ -549,14 +550,14 @@ void HTMLCanvasElement::Reset() {
bool had_resource_provider = HasResourceProvider(); bool had_resource_provider = HasResourceProvider();
unsigned w = 0; unsigned w = 0;
AtomicString value = getAttribute(kWidthAttr); AtomicString value = getAttribute(html_names::kWidthAttr);
if (value.IsEmpty() || !ParseHTMLNonNegativeInteger(value, w) || if (value.IsEmpty() || !ParseHTMLNonNegativeInteger(value, w) ||
w > 0x7fffffffu) { w > 0x7fffffffu) {
w = kDefaultCanvasWidth; w = kDefaultCanvasWidth;
} }
unsigned h = 0; unsigned h = 0;
value = getAttribute(kHeightAttr); value = getAttribute(html_names::kHeightAttr);
if (value.IsEmpty() || !ParseHTMLNonNegativeInteger(value, h) || if (value.IsEmpty() || !ParseHTMLNonNegativeInteger(value, h) ||
h > 0x7fffffffu) { h > 0x7fffffffu) {
h = kDefaultCanvasHeight; h = kDefaultCanvasHeight;
...@@ -1141,8 +1142,8 @@ void HTMLCanvasElement::SetResourceProviderForTesting( ...@@ -1141,8 +1142,8 @@ void HTMLCanvasElement::SetResourceProviderForTesting(
std::unique_ptr<Canvas2DLayerBridge> bridge, std::unique_ptr<Canvas2DLayerBridge> bridge,
const IntSize& size) { const IntSize& size) {
DiscardResourceProvider(); DiscardResourceProvider();
SetIntegralAttribute(kWidthAttr, size.Width()); SetIntegralAttribute(html_names::kWidthAttr, size.Width());
SetIntegralAttribute(kHeightAttr, size.Height()); SetIntegralAttribute(html_names::kHeightAttr, size.Height());
SetCanvas2DLayerBridgeInternal(std::move(bridge)); SetCanvas2DLayerBridgeInternal(std::move(bridge));
ReplaceResourceProvider(std::move(resource_provider)); ReplaceResourceProvider(std::move(resource_provider));
} }
......
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