Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1358 | 1358 |
| 1359 return documentElement(); | 1359 return documentElement(); |
| 1360 } | 1360 } |
| 1361 | 1361 |
| 1362 return body(); | 1362 return body(); |
| 1363 } | 1363 } |
| 1364 | 1364 |
| 1365 // We use HashMap::set over HashMap::add here as we want to | 1365 // We use HashMap::set over HashMap::add here as we want to |
| 1366 // replace the ComputedStyle but not the Node if the Node is | 1366 // replace the ComputedStyle but not the Node if the Node is |
| 1367 // already present. | 1367 // already present. |
| 1368 void Document::addStyleReattachData(Node& node, | 1368 void Document::addStyleReattachData(const Node& node, |
| 1369 StyleReattachData& styleReattachData) { | 1369 StyleReattachData& styleReattachData) { |
| 1370 DCHECK(node.isElementNode() || node.isTextNode()); | 1370 DCHECK(node.isElementNode() || node.isTextNode()); |
| 1371 m_styleReattachDataMap.set(&node, styleReattachData); | 1371 m_styleReattachDataMap.set(&node, styleReattachData); |
|
ktyliu
2017/01/13 02:04:05
not related to your change, but "&node" should bet
Bugs Nash
2017/01/13 02:08:40
the set method is taking a Node* here (or more acc
| |
| 1372 } | 1372 } |
| 1373 | 1373 |
| 1374 StyleReattachData Document::getStyleReattachData(Node& node) { | 1374 StyleReattachData Document::getStyleReattachData(const Node& node) const { |
| 1375 return m_styleReattachDataMap.get(&node); | 1375 return m_styleReattachDataMap.get(&node); |
| 1376 } | 1376 } |
| 1377 | 1377 |
| 1378 /* | 1378 /* |
| 1379 * Performs three operations: | 1379 * Performs three operations: |
| 1380 * 1. Convert control characters to spaces | 1380 * 1. Convert control characters to spaces |
| 1381 * 2. Trim leading and trailing spaces | 1381 * 2. Trim leading and trailing spaces |
| 1382 * 3. Collapse internal whitespace. | 1382 * 3. Collapse internal whitespace. |
| 1383 */ | 1383 */ |
| 1384 template <typename CharacterType> | 1384 template <typename CharacterType> |
| (...skipping 5198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6583 } | 6583 } |
| 6584 | 6584 |
| 6585 void showLiveDocumentInstances() { | 6585 void showLiveDocumentInstances() { |
| 6586 WeakDocumentSet& set = liveDocumentSet(); | 6586 WeakDocumentSet& set = liveDocumentSet(); |
| 6587 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6587 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6588 for (Document* document : set) | 6588 for (Document* document : set) |
| 6589 fprintf(stderr, "- Document %p URL: %s\n", document, | 6589 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6590 document->url().getString().utf8().data()); | 6590 document->url().getString().utf8().data()); |
| 6591 } | 6591 } |
| 6592 #endif | 6592 #endif |
| OLD | NEW |