| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 return result; | 528 return result; |
| 529 } | 529 } |
| 530 | 530 |
| 531 FastTextAutosizer::Fingerprint FastTextAutosizer::computeFingerprint(const Rende
rObject* renderer) | 531 FastTextAutosizer::Fingerprint FastTextAutosizer::computeFingerprint(const Rende
rObject* renderer) |
| 532 { | 532 { |
| 533 Node* node = renderer->generatingNode(); | 533 Node* node = renderer->generatingNode(); |
| 534 if (!node || !node->isElementNode()) | 534 if (!node || !node->isElementNode()) |
| 535 return 0; | 535 return 0; |
| 536 | 536 |
| 537 FingerprintSourceData data; | 537 FingerprintSourceData data; |
| 538 | |
| 539 // FIXME: Instead of computing and caching parent fingerprints on demand, | |
| 540 // consider maintaining a fingerprint stack during the style recalc | |
| 541 // tree walk (similar to the cluster stack used during layout). | |
| 542 | |
| 543 if (const RenderObject* parent = parentElementRenderer(renderer)) | 538 if (const RenderObject* parent = parentElementRenderer(renderer)) |
| 544 data.m_parentHash = getFingerprint(parent); | 539 data.m_parentHash = getFingerprint(parent); |
| 545 | 540 |
| 546 data.m_qualifiedNameHash = QualifiedNameHash::hash(toElement(node)->tagQName
()); | 541 data.m_qualifiedNameHash = QualifiedNameHash::hash(toElement(node)->tagQName
()); |
| 547 | 542 |
| 548 if (RenderStyle* style = renderer->style()) { | 543 if (RenderStyle* style = renderer->style()) { |
| 549 data.m_packedStyleProperties = style->direction(); | 544 data.m_packedStyleProperties = style->direction(); |
| 550 data.m_packedStyleProperties |= (style->position() << 1); | 545 data.m_packedStyleProperties |= (style->position() << 1); |
| 551 data.m_packedStyleProperties |= (style->floating() << 4); | 546 data.m_packedStyleProperties |= (style->floating() << 4); |
| 552 data.m_packedStyleProperties |= (style->display() << 6); | 547 data.m_packedStyleProperties |= (style->display() << 6); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 m_textAutosizer = 0; | 926 m_textAutosizer = 0; |
| 932 } | 927 } |
| 933 | 928 |
| 934 FastTextAutosizer::LayoutScope::~LayoutScope() | 929 FastTextAutosizer::LayoutScope::~LayoutScope() |
| 935 { | 930 { |
| 936 if (m_textAutosizer) | 931 if (m_textAutosizer) |
| 937 m_textAutosizer->endLayout(m_block); | 932 m_textAutosizer->endLayout(m_block); |
| 938 } | 933 } |
| 939 | 934 |
| 940 } // namespace WebCore | 935 } // namespace WebCore |
| OLD | NEW |