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

Side by Side Diff: Source/core/html/parser/HTMLConstructionSite.cpp

Issue 387413003: Drop findAttribute*ByName() API from Element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/html/HTMLInputElement.cpp ('k') | Source/core/xml/XPathFunctions.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) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 dispatchDocumentElementAvailableIfNeeded(); 400 dispatchDocumentElementAvailableIfNeeded();
401 } 401 }
402 402
403 void HTMLConstructionSite::mergeAttributesFromTokenIntoElement(AtomicHTMLToken* token, Element* element) 403 void HTMLConstructionSite::mergeAttributesFromTokenIntoElement(AtomicHTMLToken* token, Element* element)
404 { 404 {
405 if (token->attributes().isEmpty()) 405 if (token->attributes().isEmpty())
406 return; 406 return;
407 407
408 for (unsigned i = 0; i < token->attributes().size(); ++i) { 408 for (unsigned i = 0; i < token->attributes().size(); ++i) {
409 const Attribute& tokenAttribute = token->attributes().at(i); 409 const Attribute& tokenAttribute = token->attributes().at(i);
410 if (!element->elementData() || !element->findAttributeByName(tokenAttrib ute.name())) 410 if (!element->elementData() || element->attributes().findIndex(tokenAttr ibute.name()) == kNotFound)
411 element->setAttribute(tokenAttribute.name(), tokenAttribute.value()) ; 411 element->setAttribute(tokenAttribute.name(), tokenAttribute.value()) ;
412 } 412 }
413 } 413 }
414 414
415 void HTMLConstructionSite::insertHTMLHtmlStartTagInBody(AtomicHTMLToken* token) 415 void HTMLConstructionSite::insertHTMLHtmlStartTagInBody(AtomicHTMLToken* token)
416 { 416 {
417 // Fragments do not have a root HTML element, so any additional HTML element s 417 // Fragments do not have a root HTML element, so any additional HTML element s
418 // encountered during fragment parsing should be ignored. 418 // encountered during fragment parsing should be ignored.
419 if (m_isParsingFragment) 419 if (m_isParsingFragment)
420 return; 420 return;
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 } 870 }
871 871
872 void HTMLConstructionSite::PendingText::trace(Visitor* visitor) 872 void HTMLConstructionSite::PendingText::trace(Visitor* visitor)
873 { 873 {
874 visitor->trace(parent); 874 visitor->trace(parent);
875 visitor->trace(nextChild); 875 visitor->trace(nextChild);
876 } 876 }
877 877
878 878
879 } 879 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/xml/XPathFunctions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698