Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Side by Side Diff: Source/core/page/PageSerializer.cpp

Issue 337753005: Make iterator for Element's attributes more lightweight (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Proper rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/core/xml/XPathNodeSet.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 namespace WebCore { 70 namespace WebCore {
71 71
72 static bool isCharsetSpecifyingNode(const Node& node) 72 static bool isCharsetSpecifyingNode(const Node& node)
73 { 73 {
74 if (!isHTMLMetaElement(node)) 74 if (!isHTMLMetaElement(node))
75 return false; 75 return false;
76 76
77 const HTMLMetaElement& element = toHTMLMetaElement(node); 77 const HTMLMetaElement& element = toHTMLMetaElement(node);
78 HTMLAttributeList attributeList; 78 HTMLAttributeList attributeList;
79 if (element.hasAttributes()) { 79 if (element.hasAttributes()) {
80 AttributeIteratorAccessor attributes = element.attributesIterator(); 80 AttributeCollection attributes = element.attributes();
81 AttributeConstIterator end = attributes.end(); 81 AttributeCollection::const_iterator end = attributes.end();
82 for (AttributeConstIterator it = attributes.begin(); it != end; ++it) { 82 for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
83 // FIXME: We should deal appropriately with the attribute if they ha ve a namespace. 83 // FIXME: We should deal appropriately with the attribute if they ha ve a namespace.
84 attributeList.append(std::make_pair(it->name().localName(), it->valu e().string())); 84 attributeList.append(std::make_pair(it->name().localName(), it->valu e().string()));
85 } 85 }
86 } 86 }
87 WTF::TextEncoding textEncoding = encodingFromMetaAttributes(attributeList); 87 WTF::TextEncoding textEncoding = encodingFromMetaAttributes(attributeList);
88 return textEncoding.isValid(); 88 return textEncoding.isValid();
89 } 89 }
90 90
91 static bool shouldIgnoreElement(const Element& element) 91 static bool shouldIgnoreElement(const Element& element)
92 { 92 {
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 if (iter != m_blankFrameURLs.end()) 384 if (iter != m_blankFrameURLs.end())
385 return iter->value; 385 return iter->value;
386 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); 386 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++);
387 KURL fakeURL(ParsedURLString, url); 387 KURL fakeURL(ParsedURLString, url);
388 m_blankFrameURLs.add(frame, fakeURL); 388 m_blankFrameURLs.add(frame, fakeURL);
389 389
390 return fakeURL; 390 return fakeURL;
391 } 391 }
392 392
393 } 393 }
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/core/xml/XPathNodeSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698