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

Side by Side Diff: Source/web/WebPageSerializerImpl.cpp

Issue 137433008: Have HTMLCollection::item() return an Element as per specification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 10 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
« no previous file with comments | « Source/web/WebPageSerializer.cpp ('k') | public/web/WebNodeCollection.h » ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 if (!m_recursiveSerialization) 470 if (!m_recursiveSerialization)
471 return; 471 return;
472 // Collect all frames inside the specified frame. 472 // Collect all frames inside the specified frame.
473 for (int i = 0; i < static_cast<int>(m_frames.size()); ++i) { 473 for (int i = 0; i < static_cast<int>(m_frames.size()); ++i) {
474 WebFrameImpl* currentFrame = m_frames[i]; 474 WebFrameImpl* currentFrame = m_frames[i];
475 // Get current using document. 475 // Get current using document.
476 Document* currentDoc = currentFrame->frame()->document(); 476 Document* currentDoc = currentFrame->frame()->document();
477 // Go through sub-frames. 477 // Go through sub-frames.
478 RefPtr<HTMLCollection> all = currentDoc->all(); 478 RefPtr<HTMLCollection> all = currentDoc->all();
479 479
480 for (unsigned i = 0; Node* node = all->item(i); i++) { 480 for (unsigned i = 0; Element* element = all->item(i); i++) {
481 if (!node->isHTMLElement()) 481 if (!element->isHTMLElement())
482 continue; 482 continue;
483 Element* element = toElement(node);
484 WebFrameImpl* webFrame = 483 WebFrameImpl* webFrame =
485 WebFrameImpl::fromFrameOwnerElement(element); 484 WebFrameImpl::fromFrameOwnerElement(element);
486 if (webFrame) 485 if (webFrame)
487 m_frames.append(webFrame); 486 m_frames.append(webFrame);
488 } 487 }
489 } 488 }
490 } 489 }
491 490
492 bool WebPageSerializerImpl::serialize() 491 bool WebPageSerializerImpl::serialize()
493 { 492 {
(...skipping 24 matching lines...) Expand all
518 517
519 encodeAndFlushBuffer(WebPageSerializerClient::CurrentFrameIsFinished, &p aram, ForceFlush); 518 encodeAndFlushBuffer(WebPageSerializerClient::CurrentFrameIsFinished, &p aram, ForceFlush);
520 } 519 }
521 520
522 ASSERT(m_dataBuffer.isEmpty()); 521 ASSERT(m_dataBuffer.isEmpty());
523 m_client->didSerializeDataForFrame(KURL(), WebCString("", 0), WebPageSeriali zerClient::AllFramesAreFinished); 522 m_client->didSerializeDataForFrame(KURL(), WebCString("", 0), WebPageSeriali zerClient::AllFramesAreFinished);
524 return didSerialization; 523 return didSerialization;
525 } 524 }
526 525
527 } // namespace blink 526 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebPageSerializer.cpp ('k') | public/web/WebNodeCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698