Commit 732f8dbd authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Remove using directives ("using namespace x") in core/editing/serializers/.

Bug: 82078
Change-Id: I9b6f6c5fcd9b8a7235033f7d4e48dc70f3274591
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1870416
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708572}
parent 38dfe964
......@@ -47,8 +47,6 @@
namespace blink {
using namespace html_names;
struct EntityDescription {
UChar entity;
const std::string& reference;
......@@ -388,11 +386,15 @@ EntityMask MarkupFormatter::EntityMaskForText(const Text& text) const {
parent_name = &(text.parentElement())->TagQName();
if (parent_name &&
(*parent_name == kScriptTag || *parent_name == kStyleTag ||
*parent_name == kXmpTag || *parent_name == kIFrameTag ||
*parent_name == kPlaintextTag || *parent_name == kNoembedTag ||
*parent_name == kNoframesTag ||
(*parent_name == kNoscriptTag && text.GetDocument().GetFrame() &&
(*parent_name == html_names::kScriptTag ||
*parent_name == html_names::kStyleTag ||
*parent_name == html_names::kXmpTag ||
*parent_name == html_names::kIFrameTag ||
*parent_name == html_names::kPlaintextTag ||
*parent_name == html_names::kNoembedTag ||
*parent_name == html_names::kNoframesTag ||
(*parent_name == html_names::kNoscriptTag &&
text.GetDocument().GetFrame() &&
text.GetDocument().CanExecuteScripts(kNotAboutToExecuteScript))))
return kEntityMaskInCDATA;
return kEntityMaskInHTMLPCDATA;
......
......@@ -72,8 +72,6 @@
namespace blink {
using namespace html_names;
class AttributeChange {
DISALLOW_NEW();
......@@ -131,7 +129,7 @@ static HTMLElement* AncestorToRetainStructureAndAppearanceForBlock(
if (!common_ancestor_block)
return nullptr;
if (common_ancestor_block->HasTagName(kTbodyTag) ||
if (common_ancestor_block->HasTagName(html_names::kTbodyTag) ||
IsHTMLTableRowElement(*common_ancestor_block))
return Traversal<HTMLTableElement>::FirstAncestor(*common_ancestor_block);
......@@ -251,7 +249,7 @@ static HTMLElement* HighestAncestorToWrapMarkup(
Position::FirstPositionInNode(special_common_ancestor
? *special_common_ancestor
: *common_ancestor),
kATag)))
html_names::kATag)))
special_common_ancestor = enclosing_anchor;
return special_common_ancestor;
......@@ -562,7 +560,7 @@ DocumentFragment* CreateFragmentFromText(const EphemeralRange& context,
fragment->AppendChild(document.createTextNode(string));
if (string.EndsWith('\n')) {
auto* element = MakeGarbageCollected<HTMLBRElement>(document);
element->setAttribute(kClassAttr, AppleInterchangeNewline);
element->setAttribute(html_names::kClassAttr, AppleInterchangeNewline);
fragment->AppendChild(element);
}
return fragment;
......@@ -592,7 +590,7 @@ DocumentFragment* CreateFragmentFromText(const EphemeralRange& context,
if (s.IsEmpty() && i + 1 == num_lines) {
// For last line, use the "magic BR" rather than a P.
element = MakeGarbageCollected<HTMLBRElement>(document);
element->setAttribute(kClassAttr, AppleInterchangeNewline);
element->setAttribute(html_names::kClassAttr, AppleInterchangeNewline);
} else {
if (use_clones_of_enclosing_block)
element = &block->CloneWithoutChildren();
......
......@@ -49,8 +49,6 @@ wtf_size_t TotalLength(const Vector<String>& strings) {
} // namespace
using namespace html_names;
StyledMarkupAccumulator::StyledMarkupAccumulator(
AbsoluteURLs should_resolve_urls,
const TextOffset& start,
......@@ -119,7 +117,7 @@ void StyledMarkupAccumulator::AppendTextWithInlineStyle(
AppendText(text);
} else {
const bool use_rendered_text = !EnclosingElementWithTag(
Position::FirstPositionInNode(text), kSelectTag);
Position::FirstPositionInNode(text), html_names::kSelectTag);
String content =
use_rendered_text ? RenderedText(text) : StringValueForRange(text);
StringBuilder buffer;
......@@ -146,7 +144,7 @@ void StyledMarkupAccumulator::AppendElementWithInlineStyle(
AttributeCollection attributes = element.Attributes();
for (const auto& attribute : attributes) {
// We'll handle the style attribute separately, below.
if (attribute.GetName() == kStyleAttr)
if (attribute.GetName() == html_names::kStyleAttr)
continue;
AppendAttribute(out, element, attribute);
}
......
......@@ -79,8 +79,6 @@ bool HandleSelectionBoundary<EditingInFlatTreeStrategy>(const Node& node) {
} // namespace
using namespace html_names;
template <typename Strategy>
class StyledMarkupTraverser {
STACK_ALLOCATED();
......@@ -233,7 +231,7 @@ String StyledMarkupSerializer<Strategy>::CreateMarkup() {
*start_.ComputeContainerNode(), *end_.ComputeContainerNode());
DCHECK(common_ancestor);
auto* body = To<HTMLBodyElement>(EnclosingElementWithTag(
Position::FirstPositionInNode(*common_ancestor), kBodyTag));
Position::FirstPositionInNode(*common_ancestor), html_names::kBodyTag));
HTMLBodyElement* fully_selected_root = nullptr;
// FIXME: Do this for all fully selected blocks, not just the body.
if (body && AreSameRanges(body, start_, end_))
......@@ -255,10 +253,12 @@ String StyledMarkupSerializer<Strategy>::CreateMarkup() {
!fully_selected_root_style->Style() ||
!fully_selected_root_style->Style()->GetPropertyCSSValue(
CSSPropertyID::kBackgroundImage)) &&
fully_selected_root->hasAttribute(kBackgroundAttr)) {
fully_selected_root->hasAttribute(html_names::kBackgroundAttr)) {
fully_selected_root_style->Style()->SetProperty(
CSSPropertyID::kBackgroundImage,
"url('" + fully_selected_root->getAttribute(kBackgroundAttr) +
"url('" +
fully_selected_root->getAttribute(
html_names::kBackgroundAttr) +
"')",
/* important */ false,
fully_selected_root->GetDocument().GetSecureContextMode());
......@@ -370,7 +370,7 @@ Node* StyledMarkupTraverser<Strategy>::Traverse(Node* start_node,
if (n->GetLayoutObject() ||
(element && element->HasDisplayContentsStyle()) ||
EnclosingElementWithTag(FirstPositionInOrBeforeNode(*n),
kSelectTag)) {
html_names::kSelectTag)) {
// Add the node to the markup if we're not skipping the descendants
AppendStartMarkup(*n);
......
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