| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "web/PopupMenuImpl.h" | 5 #include "web/PopupMenuImpl.h" |
| 6 | 6 |
| 7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/css/CSSFontSelector.h" | 8 #include "core/css/CSSFontSelector.h" |
| 9 #include "core/dom/ElementTraversal.h" | 9 #include "core/dom/ElementTraversal.h" |
| 10 #include "core/dom/ExecutionContextTask.h" | 10 #include "core/dom/ExecutionContextTask.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 } | 469 } |
| 470 | 470 |
| 471 void PopupMenuImpl::updateFromElement() | 471 void PopupMenuImpl::updateFromElement() |
| 472 { | 472 { |
| 473 if (m_needsUpdate) | 473 if (m_needsUpdate) |
| 474 return; | 474 return; |
| 475 m_needsUpdate = true; | 475 m_needsUpdate = true; |
| 476 ownerElement().document().postTask(BLINK_FROM_HERE, createSameThreadTask(&Po
pupMenuImpl::update, this)); | 476 ownerElement().document().postTask(BLINK_FROM_HERE, createSameThreadTask(&Po
pupMenuImpl::update, this)); |
| 477 } | 477 } |
| 478 | 478 |
| 479 void PopupMenuImpl::updateFromElementWithMutation() |
| 480 { |
| 481 updateFromElement(); |
| 482 } |
| 483 |
| 479 void PopupMenuImpl::update() | 484 void PopupMenuImpl::update() |
| 480 { | 485 { |
| 481 if (!m_popup || !m_ownerElement) | 486 if (!m_popup || !m_ownerElement) |
| 482 return; | 487 return; |
| 483 ownerElement().document().updateLayoutTree(); | 488 ownerElement().document().updateLayoutTree(); |
| 484 // disconnectClient() might have been called. | 489 // disconnectClient() might have been called. |
| 485 if (!m_ownerElement) | 490 if (!m_ownerElement) |
| 486 return; | 491 return; |
| 487 m_needsUpdate = false; | 492 m_needsUpdate = false; |
| 488 | 493 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 525 |
| 521 void PopupMenuImpl::disconnectClient() | 526 void PopupMenuImpl::disconnectClient() |
| 522 { | 527 { |
| 523 m_ownerElement = nullptr; | 528 m_ownerElement = nullptr; |
| 524 // Cannot be done during finalization, so instead done when the | 529 // Cannot be done during finalization, so instead done when the |
| 525 // layout object is destroyed and disconnected. | 530 // layout object is destroyed and disconnected. |
| 526 dispose(); | 531 dispose(); |
| 527 } | 532 } |
| 528 | 533 |
| 529 } // namespace blink | 534 } // namespace blink |
| OLD | NEW |