OLD | NEW |
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 StringBuilder result; | 296 StringBuilder result; |
297 // Do pre action for open tag. | 297 // Do pre action for open tag. |
298 result.append(preActionBeforeSerializeOpenTag(element, param, &needSkip)); | 298 result.append(preActionBeforeSerializeOpenTag(element, param, &needSkip)); |
299 if (needSkip) | 299 if (needSkip) |
300 return; | 300 return; |
301 // Add open tag | 301 // Add open tag |
302 result.append('<'); | 302 result.append('<'); |
303 result.append(element->nodeName().lower()); | 303 result.append(element->nodeName().lower()); |
304 // Go through all attributes and serialize them. | 304 // Go through all attributes and serialize them. |
305 AttributeCollection attributes = element->attributes(); | 305 AttributeCollection attributes = element->attributes(); |
306 AttributeCollection::const_iterator end = attributes.end(); | 306 AttributeCollection::iterator end = attributes.end(); |
307 for (AttributeCollection::const_iterator it = attributes.begin(); it != end;
++it) { | 307 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it)
{ |
308 result.append(' '); | 308 result.append(' '); |
309 // Add attribute pair | 309 // Add attribute pair |
310 result.append(it->name().toString()); | 310 result.append(it->name().toString()); |
311 result.appendLiteral("=\""); | 311 result.appendLiteral("=\""); |
312 if (!it->value().isEmpty()) { | 312 if (!it->value().isEmpty()) { |
313 const String& attrValue = it->value(); | 313 const String& attrValue = it->value(); |
314 | 314 |
315 // Check whether we need to replace some resource links | 315 // Check whether we need to replace some resource links |
316 // with local resource paths. | 316 // with local resource paths. |
317 const QualifiedName& attrName = it->name(); | 317 const QualifiedName& attrName = it->name(); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 514 |
515 encodeAndFlushBuffer(WebPageSerializerClient::CurrentFrameIsFinished, &p
aram, ForceFlush); | 515 encodeAndFlushBuffer(WebPageSerializerClient::CurrentFrameIsFinished, &p
aram, ForceFlush); |
516 } | 516 } |
517 | 517 |
518 ASSERT(m_dataBuffer.isEmpty()); | 518 ASSERT(m_dataBuffer.isEmpty()); |
519 m_client->didSerializeDataForFrame(KURL(), WebCString("", 0), WebPageSeriali
zerClient::AllFramesAreFinished); | 519 m_client->didSerializeDataForFrame(KURL(), WebCString("", 0), WebPageSeriali
zerClient::AllFramesAreFinished); |
520 return didSerialization; | 520 return didSerialization; |
521 } | 521 } |
522 | 522 |
523 } // namespace blink | 523 } // namespace blink |
OLD | NEW |