Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
| 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1711 String(&revealed_text, 1)); | 1711 String(&revealed_text, 1)); |
| 1712 // m_text may be updated later before timer fires. We invalidate the | 1712 // m_text may be updated later before timer fires. We invalidate the |
| 1713 // lastTypedCharacterOffset to avoid inconsistency. | 1713 // lastTypedCharacterOffset to avoid inconsistency. |
| 1714 secure_text_timer->Invalidate(); | 1714 secure_text_timer->Invalidate(); |
| 1715 } | 1715 } |
| 1716 } | 1716 } |
| 1717 | 1717 |
| 1718 void LayoutText::SetText(PassRefPtr<StringImpl> text, bool force) { | 1718 void LayoutText::SetText(PassRefPtr<StringImpl> text, bool force) { |
| 1719 DCHECK(text); | 1719 DCHECK(text); |
| 1720 | 1720 |
| 1721 bool equal = Equal(text_.Impl(), text.Get()); | 1721 if (!force && Equal(text_.Impl(), text.Get())) |
|
dmazzoni
2017/05/12 06:46:15
Note that the changes in this file are just a reve
| |
| 1722 if (equal && !force) | |
| 1723 return; | 1722 return; |
| 1724 | 1723 |
| 1725 SetTextInternal(std::move(text)); | 1724 SetTextInternal(std::move(text)); |
| 1726 // If preferredLogicalWidthsDirty() of an orphan child is true, | 1725 // If preferredLogicalWidthsDirty() of an orphan child is true, |
| 1727 // LayoutObjectChildList::insertChildNode() fails to set true to owner. | 1726 // LayoutObjectChildList::insertChildNode() fails to set true to owner. |
| 1728 // To avoid that, we call setNeedsLayoutAndPrefWidthsRecalc() only if this | 1727 // To avoid that, we call setNeedsLayoutAndPrefWidthsRecalc() only if this |
| 1729 // LayoutText has parent. | 1728 // LayoutText has parent. |
| 1730 if (Parent()) | 1729 if (Parent()) |
| 1731 SetNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation( | 1730 SetNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation( |
| 1732 LayoutInvalidationReason::kTextChanged); | 1731 LayoutInvalidationReason::kTextChanged); |
| 1733 known_to_have_no_overflow_and_no_fallback_fonts_ = false; | 1732 known_to_have_no_overflow_and_no_fallback_fonts_ = false; |
| 1734 | 1733 |
| 1735 // Don't bother updating the AX tree if there's no change. Otherwise, when | 1734 if (AXObjectCache* cache = GetDocument().ExistingAXObjectCache()) |
| 1736 // typing in password fields, we would announce each "dot" twice: once when a | 1735 cache->TextChanged(this); |
| 1737 // character is typed, and second when that character is hidden. | |
| 1738 if (!equal) { | |
| 1739 AXObjectCache* cache = GetDocument().ExistingAXObjectCache(); | |
| 1740 if (cache) | |
| 1741 cache->TextChanged(this); | |
| 1742 } | |
| 1743 | 1736 |
| 1744 TextAutosizer* text_autosizer = GetDocument().GetTextAutosizer(); | 1737 TextAutosizer* text_autosizer = GetDocument().GetTextAutosizer(); |
| 1745 if (text_autosizer) | 1738 if (text_autosizer) |
| 1746 text_autosizer->Record(this); | 1739 text_autosizer->Record(this); |
| 1747 } | 1740 } |
| 1748 | 1741 |
| 1749 void LayoutText::DirtyOrDeleteLineBoxesIfNeeded(bool full_layout) { | 1742 void LayoutText::DirtyOrDeleteLineBoxesIfNeeded(bool full_layout) { |
| 1750 if (full_layout) | 1743 if (full_layout) |
| 1751 DeleteTextBoxes(); | 1744 DeleteTextBoxes(); |
| 1752 else if (!lines_dirty_) | 1745 else if (!lines_dirty_) |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2055 LayoutRect rect = LayoutRect( | 2048 LayoutRect rect = LayoutRect( |
| 2056 IntRect(FirstRunX(), FirstRunY(), lines_box.Width(), lines_box.Height())); | 2049 IntRect(FirstRunX(), FirstRunY(), lines_box.Width(), lines_box.Height())); |
| 2057 LayoutBlock* block = ContainingBlock(); | 2050 LayoutBlock* block = ContainingBlock(); |
| 2058 if (block && HasTextBoxes()) | 2051 if (block && HasTextBoxes()) |
| 2059 block->AdjustChildDebugRect(rect); | 2052 block->AdjustChildDebugRect(rect); |
| 2060 | 2053 |
| 2061 return rect; | 2054 return rect; |
| 2062 } | 2055 } |
| 2063 | 2056 |
| 2064 } // namespace blink | 2057 } // namespace blink |
| OLD | NEW |