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

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

Issue 712333004: Create the document font using normal FontBuilder calls. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Recreate patch on new master. Created 5 years, 10 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/core/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, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights 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, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 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 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 } 1616 }
1617 Node* root = node; 1617 Node* root = node;
1618 while (Node* host = root->shadowHost()) 1618 while (Node* host = root->shadowHost())
1619 root = host; 1619 root = host;
1620 while (Node* ancestor = root->parentOrShadowHostNode()) 1620 while (Node* ancestor = root->parentOrShadowHostNode())
1621 root = ancestor; 1621 root = ancestor;
1622 if (root->childNeedsDistributionRecalc()) 1622 if (root->childNeedsDistributionRecalc())
1623 root->recalcDistribution(); 1623 root->recalcDistribution();
1624 } 1624 }
1625 1625
1626 void Document::setupFontBuilder(RenderStyle* documentStyle) 1626 void Document::createFont(RenderStyle* documentStyle)
1627 { 1627 {
1628 FontBuilder fontBuilder(*this); 1628 FontBuilder fontBuilder(*this);
1629 RefPtrWillBeRawPtr<CSSFontSelector> selector = m_styleEngine->fontSelector() ; 1629 fontBuilder.setScript(documentStyle->locale());
1630 fontBuilder.createFontForDocument(selector, documentStyle); 1630 fontBuilder.setFamilyDescription(FontBuilder::initialFamilyDescription());
1631 fontBuilder.setSize(FontBuilder::initialSize());
1632 fontBuilder.createFont(m_styleEngine->fontSelector(), documentStyle);
1631 } 1633 }
1632 1634
1633 void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change) 1635 void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
1634 { 1636 {
1635 ASSERT(inStyleRecalc()); 1637 ASSERT(inStyleRecalc());
1636 ASSERT(documentElement()); 1638 ASSERT(documentElement());
1637 1639
1638 RefPtr<RenderStyle> documentElementStyle = documentElement()->renderStyle(); 1640 RefPtr<RenderStyle> documentElementStyle = documentElement()->renderStyle();
1639 if (!documentElementStyle || documentElement()->needsStyleRecalc() || change == Force) 1641 if (!documentElementStyle || documentElement()->needsStyleRecalc() || change == Force)
1640 documentElementStyle = ensureStyleResolver().styleForElement(documentEle ment()); 1642 documentElementStyle = ensureStyleResolver().styleForElement(documentEle ment());
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 || documentStyle->columnGap() != columnGap 1702 || documentStyle->columnGap() != columnGap
1701 || documentStyle->scrollBlocksOn() != scrollBlocksOn) { 1703 || documentStyle->scrollBlocksOn() != scrollBlocksOn) {
1702 RefPtr<RenderStyle> newStyle = RenderStyle::clone(documentStyle.get()); 1704 RefPtr<RenderStyle> newStyle = RenderStyle::clone(documentStyle.get());
1703 newStyle->setWritingMode(rootWritingMode); 1705 newStyle->setWritingMode(rootWritingMode);
1704 newStyle->setDirection(rootDirection); 1706 newStyle->setDirection(rootDirection);
1705 newStyle->setColumnGap(columnGap); 1707 newStyle->setColumnGap(columnGap);
1706 newStyle->setOverflowX(overflowX); 1708 newStyle->setOverflowX(overflowX);
1707 newStyle->setOverflowY(overflowY); 1709 newStyle->setOverflowY(overflowY);
1708 newStyle->setScrollBlocksOn(scrollBlocksOn); 1710 newStyle->setScrollBlocksOn(scrollBlocksOn);
1709 renderView()->setStyle(newStyle); 1711 renderView()->setStyle(newStyle);
1710 setupFontBuilder(newStyle.get()); 1712 createFont(newStyle.get());
1711 } 1713 }
1712 1714
1713 if (body) { 1715 if (body) {
1714 if (RenderStyle* style = body->renderStyle()) { 1716 if (RenderStyle* style = body->renderStyle()) {
1715 if (style->direction() != rootDirection || style->writingMode() != r ootWritingMode) 1717 if (style->direction() != rootDirection || style->writingMode() != r ootWritingMode)
1716 body->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonF orTracing::create(StyleChangeReason::WritingModeChange)); 1718 body->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonF orTracing::create(StyleChangeReason::WritingModeChange));
1717 } 1719 }
1718 } 1720 }
1719 1721
1720 if (RenderStyle* style = documentElement()->renderStyle()) { 1722 if (RenderStyle* style = documentElement()->renderStyle()) {
(...skipping 4041 matching lines...) Expand 10 before | Expand all | Expand 10 after
5762 #ifndef NDEBUG 5764 #ifndef NDEBUG
5763 using namespace blink; 5765 using namespace blink;
5764 void showLiveDocumentInstances() 5766 void showLiveDocumentInstances()
5765 { 5767 {
5766 WeakDocumentSet& set = liveDocumentSet(); 5768 WeakDocumentSet& set = liveDocumentSet();
5767 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5769 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5768 for (Document* document : set) 5770 for (Document* document : set)
5769 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5771 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5770 } 5772 }
5771 #endif 5773 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698