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

Side by Side Diff: Source/core/rendering/FastTextAutosizer.cpp

Issue 207193002: [FastTextAutosizer] Remove comment about storing a fingerprint stack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698