| 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 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights
reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * | 10 * |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 m_elemSheet->clearOwnerNode(); | 539 m_elemSheet->clearOwnerNode(); |
| 540 if (m_mappedElementSheet) | 540 if (m_mappedElementSheet) |
| 541 m_mappedElementSheet->clearOwnerNode(); | 541 m_mappedElementSheet->clearOwnerNode(); |
| 542 if (m_pageUserSheet) | 542 if (m_pageUserSheet) |
| 543 m_pageUserSheet->clearOwnerNode(); | 543 m_pageUserSheet->clearOwnerNode(); |
| 544 if (m_pageGroupUserSheets) { | 544 if (m_pageGroupUserSheets) { |
| 545 for (size_t i = 0; i < m_pageGroupUserSheets->size(); ++i) | 545 for (size_t i = 0; i < m_pageGroupUserSheets->size(); ++i) |
| 546 (*m_pageGroupUserSheets)[i]->clearOwnerNode(); | 546 (*m_pageGroupUserSheets)[i]->clearOwnerNode(); |
| 547 } | 547 } |
| 548 | 548 |
| 549 deleteRetiredCustomFonts(); |
| 550 |
| 549 m_weakReference->clear(); | 551 m_weakReference->clear(); |
| 550 | 552 |
| 551 if (m_mediaQueryMatcher) | 553 if (m_mediaQueryMatcher) |
| 552 m_mediaQueryMatcher->documentDestroyed(); | 554 m_mediaQueryMatcher->documentDestroyed(); |
| 553 } | 555 } |
| 554 | 556 |
| 555 void Document::removedLastRef() | 557 void Document::removedLastRef() |
| 556 { | 558 { |
| 557 ASSERT(!m_deletionHasBegun); | 559 ASSERT(!m_deletionHasBegun); |
| 558 if (m_guardRefCount) { | 560 if (m_guardRefCount) { |
| (...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 RefPtr<RenderStyle> documentStyle = CSSStyleSelector::styleForDocument(t
his); | 1523 RefPtr<RenderStyle> documentStyle = CSSStyleSelector::styleForDocument(t
his); |
| 1522 StyleChange ch = diff(documentStyle.get(), renderer()->style()); | 1524 StyleChange ch = diff(documentStyle.get(), renderer()->style()); |
| 1523 if (ch != NoChange) | 1525 if (ch != NoChange) |
| 1524 renderer()->setStyle(documentStyle.release()); | 1526 renderer()->setStyle(documentStyle.release()); |
| 1525 } | 1527 } |
| 1526 | 1528 |
| 1527 for (Node* n = firstChild(); n; n = n->nextSibling()) | 1529 for (Node* n = firstChild(); n; n = n->nextSibling()) |
| 1528 if (change >= Inherit || n->childNeedsStyleRecalc() || n->needsStyleReca
lc()) | 1530 if (change >= Inherit || n->childNeedsStyleRecalc() || n->needsStyleReca
lc()) |
| 1529 n->recalcStyle(change); | 1531 n->recalcStyle(change); |
| 1530 | 1532 |
| 1533 // Now that all RenderStyles that pointed to retired fonts have been updated
, the fonts can safely be deleted. |
| 1534 deleteRetiredCustomFonts(); |
| 1535 |
| 1531 #if USE(ACCELERATED_COMPOSITING) | 1536 #if USE(ACCELERATED_COMPOSITING) |
| 1532 if (view()) { | 1537 if (view()) { |
| 1533 bool layoutPending = view()->layoutPending() || renderer()->needsLayout(
); | 1538 bool layoutPending = view()->layoutPending() || renderer()->needsLayout(
); |
| 1534 // If we didn't update compositing layers because of layout(), we need t
o do so here. | 1539 // If we didn't update compositing layers because of layout(), we need t
o do so here. |
| 1535 if (!layoutPending) | 1540 if (!layoutPending) |
| 1536 view()->updateCompositingLayers(); | 1541 view()->updateCompositingLayers(); |
| 1537 } | 1542 } |
| 1538 #endif | 1543 #endif |
| 1539 | 1544 |
| 1540 bail_out: | 1545 bail_out: |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1657 m_ignorePendingStylesheets = oldIgnore; | 1662 m_ignorePendingStylesheets = oldIgnore; |
| 1658 return style.release(); | 1663 return style.release(); |
| 1659 } | 1664 } |
| 1660 | 1665 |
| 1661 PassRefPtr<RenderStyle> Document::styleForPage(int pageIndex) | 1666 PassRefPtr<RenderStyle> Document::styleForPage(int pageIndex) |
| 1662 { | 1667 { |
| 1663 RefPtr<RenderStyle> style = styleSelector()->styleForPage(pageIndex); | 1668 RefPtr<RenderStyle> style = styleSelector()->styleForPage(pageIndex); |
| 1664 return style.release(); | 1669 return style.release(); |
| 1665 } | 1670 } |
| 1666 | 1671 |
| 1672 void Document::retireCustomFont(FontData* fontData) |
| 1673 { |
| 1674 m_retiredCustomFonts.append(adoptPtr(fontData)); |
| 1675 } |
| 1676 |
| 1677 void Document::deleteRetiredCustomFonts() |
| 1678 { |
| 1679 size_t size = m_retiredCustomFonts.size(); |
| 1680 for (size_t i = 0; i < size; ++i) |
| 1681 GlyphPageTreeNode::pruneTreeCustomFontData(m_retiredCustomFonts[i].get()
); |
| 1682 |
| 1683 m_retiredCustomFonts.clear(); |
| 1684 } |
| 1685 |
| 1667 bool Document::isPageBoxVisible(int pageIndex) | 1686 bool Document::isPageBoxVisible(int pageIndex) |
| 1668 { | 1687 { |
| 1669 RefPtr<RenderStyle> style = styleForPage(pageIndex); | 1688 RefPtr<RenderStyle> style = styleForPage(pageIndex); |
| 1670 return style->visibility() != HIDDEN; // display property doesn't apply to @
page. | 1689 return style->visibility() != HIDDEN; // display property doesn't apply to @
page. |
| 1671 } | 1690 } |
| 1672 | 1691 |
| 1673 void Document::pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int&
marginTop, int& marginRight, int& marginBottom, int& marginLeft) | 1692 void Document::pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int&
marginTop, int& marginRight, int& marginBottom, int& marginLeft) |
| 1674 { | 1693 { |
| 1675 RefPtr<RenderStyle> style = styleForPage(pageIndex); | 1694 RefPtr<RenderStyle> style = styleForPage(pageIndex); |
| 1676 | 1695 |
| (...skipping 3394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5071 if (!loader) | 5090 if (!loader) |
| 5072 return 0; | 5091 return 0; |
| 5073 | 5092 |
| 5074 if (m_frame->document() != this) | 5093 if (m_frame->document() != this) |
| 5075 return 0; | 5094 return 0; |
| 5076 | 5095 |
| 5077 return loader; | 5096 return loader; |
| 5078 } | 5097 } |
| 5079 | 5098 |
| 5080 } // namespace WebCore | 5099 } // namespace WebCore |
| OLD | NEW |