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

Side by Side Diff: Source/WebCore/dom/Document.cpp

Issue 8273018: Merge 97402 - Source/WebCore: Register custom fonts at their creation time, rather than at retire... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 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
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | 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) 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 m_pageUserSheet->clearOwnerNode(); 567 m_pageUserSheet->clearOwnerNode();
568 if (m_pageGroupUserSheets) { 568 if (m_pageGroupUserSheets) {
569 for (size_t i = 0; i < m_pageGroupUserSheets->size(); ++i) 569 for (size_t i = 0; i < m_pageGroupUserSheets->size(); ++i)
570 (*m_pageGroupUserSheets)[i]->clearOwnerNode(); 570 (*m_pageGroupUserSheets)[i]->clearOwnerNode();
571 } 571 }
572 if (m_userSheets) { 572 if (m_userSheets) {
573 for (size_t i = 0; i < m_userSheets->size(); ++i) 573 for (size_t i = 0; i < m_userSheets->size(); ++i)
574 (*m_userSheets)[i]->clearOwnerNode(); 574 (*m_userSheets)[i]->clearOwnerNode();
575 } 575 }
576 576
577 deleteRetiredCustomFonts(); 577 deleteCustomFonts();
578 578
579 m_weakReference->clear(); 579 m_weakReference->clear();
580 580
581 if (m_mediaQueryMatcher) 581 if (m_mediaQueryMatcher)
582 m_mediaQueryMatcher->documentDestroyed(); 582 m_mediaQueryMatcher->documentDestroyed();
583 } 583 }
584 584
585 void Document::removedLastRef() 585 void Document::removedLastRef()
586 { 586 {
587 ASSERT(!m_deletionHasBegun); 587 ASSERT(!m_deletionHasBegun);
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 } 1557 }
1558 1558
1559 for (Node* n = firstChild(); n; n = n->nextSibling()) { 1559 for (Node* n = firstChild(); n; n = n->nextSibling()) {
1560 if (!n->isElementNode()) 1560 if (!n->isElementNode())
1561 continue; 1561 continue;
1562 Element* element = static_cast<Element*>(n); 1562 Element* element = static_cast<Element*>(n);
1563 if (change >= Inherit || element->childNeedsStyleRecalc() || element->ne edsStyleRecalc()) 1563 if (change >= Inherit || element->childNeedsStyleRecalc() || element->ne edsStyleRecalc())
1564 element->recalcStyle(change); 1564 element->recalcStyle(change);
1565 } 1565 }
1566 1566
1567 // FIXME: Disabling the deletion of retired custom font data until
1568 // we fix all the stale style bugs (68804, 68624, etc). These bugs
1569 // indicate problems where some styles were not updated in recalcStyle,
1570 // thereby retaining stale copy of font data. To prevent that, we
1571 // disable this code for now and only delete retired custom font data
1572 // in Document destructor.
1573 // Now that all RenderStyles that pointed to retired fonts have been updated , the fonts can safely be deleted.
1574 // deleteRetiredCustomFonts();
1575
1576 #if USE(ACCELERATED_COMPOSITING) 1567 #if USE(ACCELERATED_COMPOSITING)
1577 if (view()) { 1568 if (view()) {
1578 bool layoutPending = view()->layoutPending() || renderer()->needsLayout( ); 1569 bool layoutPending = view()->layoutPending() || renderer()->needsLayout( );
1579 // If we didn't update compositing layers because of layout(), we need t o do so here. 1570 // If we didn't update compositing layers because of layout(), we need t o do so here.
1580 if (!layoutPending) 1571 if (!layoutPending)
1581 view()->updateCompositingLayers(); 1572 view()->updateCompositingLayers();
1582 } 1573 }
1583 #endif 1574 #endif
1584 1575
1585 bail_out: 1576 bail_out:
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 m_ignorePendingStylesheets = oldIgnore; 1693 m_ignorePendingStylesheets = oldIgnore;
1703 return style.release(); 1694 return style.release();
1704 } 1695 }
1705 1696
1706 PassRefPtr<RenderStyle> Document::styleForPage(int pageIndex) 1697 PassRefPtr<RenderStyle> Document::styleForPage(int pageIndex)
1707 { 1698 {
1708 RefPtr<RenderStyle> style = styleSelector()->styleForPage(pageIndex); 1699 RefPtr<RenderStyle> style = styleSelector()->styleForPage(pageIndex);
1709 return style.release(); 1700 return style.release();
1710 } 1701 }
1711 1702
1712 void Document::retireCustomFont(FontData* fontData) 1703 void Document::registerCustomFont(FontData* fontData)
1713 { 1704 {
1714 m_retiredCustomFonts.append(adoptPtr(fontData)); 1705 m_customFonts.append(adoptPtr(fontData));
1715 } 1706 }
1716 1707
1717 void Document::deleteRetiredCustomFonts() 1708 void Document::deleteCustomFonts()
1718 { 1709 {
1719 size_t size = m_retiredCustomFonts.size(); 1710 size_t size = m_customFonts.size();
1720 for (size_t i = 0; i < size; ++i) 1711 for (size_t i = 0; i < size; ++i)
1721 GlyphPageTreeNode::pruneTreeCustomFontData(m_retiredCustomFonts[i].get() ); 1712 GlyphPageTreeNode::pruneTreeCustomFontData(m_customFonts[i].get());
1722 1713
1723 m_retiredCustomFonts.clear(); 1714 m_customFonts.clear();
1724 } 1715 }
1725 1716
1726 bool Document::isPageBoxVisible(int pageIndex) 1717 bool Document::isPageBoxVisible(int pageIndex)
1727 { 1718 {
1728 RefPtr<RenderStyle> style = styleForPage(pageIndex); 1719 RefPtr<RenderStyle> style = styleForPage(pageIndex);
1729 return style->visibility() != HIDDEN; // display property doesn't apply to @ page. 1720 return style->visibility() != HIDDEN; // display property doesn't apply to @ page.
1730 } 1721 }
1731 1722
1732 void Document::pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft) 1723 void Document::pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft)
1733 { 1724 {
(...skipping 3433 matching lines...) Expand 10 before | Expand all | Expand 10 after
5167 if (!loader) 5158 if (!loader)
5168 return 0; 5159 return 0;
5169 5160
5170 if (m_frame->document() != this) 5161 if (m_frame->document() != this)
5171 return 0; 5162 return 0;
5172 5163
5173 return loader; 5164 return loader;
5174 } 5165 }
5175 5166
5176 } // namespace WebCore 5167 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698