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

Side by Side Diff: Source/core/css/resolver/FontBuilder.cpp

Issue 300553009: Get rid of useSVGZoomRules in FontBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Simplified patch by only including the removal of useSVGZoomRules and leave foreignObject issues fo… Created 6 years, 6 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/css/resolver/FontBuilder.h ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 m_fontBuilder->didChangeFontParameters(m_fontBuilder->m_style->setFontDe scription(m_fontDescription)); 55 m_fontBuilder->didChangeFontParameters(m_fontBuilder->m_style->setFontDe scription(m_fontDescription));
56 } 56 }
57 57
58 private: 58 private:
59 FontBuilder* m_fontBuilder; 59 FontBuilder* m_fontBuilder;
60 FontDescription m_fontDescription; 60 FontDescription m_fontDescription;
61 }; 61 };
62 62
63 FontBuilder::FontBuilder() 63 FontBuilder::FontBuilder()
64 : m_document(0) 64 : m_document(0)
65 , m_useSVGZoomRules(false)
66 , m_fontSizehasViewportUnits(false) 65 , m_fontSizehasViewportUnits(false)
67 , m_style(0) 66 , m_style(0)
68 , m_fontDirty(false) 67 , m_fontDirty(false)
69 { 68 {
70 } 69 }
71 70
72 void FontBuilder::initForStyleResolve(const Document& document, RenderStyle* sty le, bool useSVGZoomRules) 71 void FontBuilder::initForStyleResolve(const Document& document, RenderStyle* sty le)
73 { 72 {
74 ASSERT(document.frame()); 73 ASSERT(document.frame());
75 m_document = &document; 74 m_document = &document;
76 m_useSVGZoomRules = useSVGZoomRules;
77 m_style = style; 75 m_style = style;
78 m_fontDirty = false; 76 m_fontDirty = false;
79 } 77 }
80 78
81 inline static void setFontFamilyToStandard(FontDescription& fontDescription, con st Document* document) 79 inline static void setFontFamilyToStandard(FontDescription& fontDescription, con st Document* document)
82 { 80 {
83 if (!document || !document->settings()) 81 if (!document || !document->settings())
84 return; 82 return;
85 83
86 fontDescription.setGenericFamily(FontDescription::StandardFamily); 84 fontDescription.setGenericFamily(FontDescription::StandardFamily);
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 } 521 }
524 522
525 void FontBuilder::setSize(FontDescription& fontDescription, float effectiveZoom, float size) 523 void FontBuilder::setSize(FontDescription& fontDescription, float effectiveZoom, float size)
526 { 524 {
527 fontDescription.setSpecifiedSize(size); 525 fontDescription.setSpecifiedSize(size);
528 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescrip tion, effectiveZoom, size)); 526 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescrip tion, effectiveZoom, size));
529 } 527 }
530 528
531 float FontBuilder::getComputedSizeFromSpecifiedSize(FontDescription& fontDescrip tion, float effectiveZoom, float specifiedSize) 529 float FontBuilder::getComputedSizeFromSpecifiedSize(FontDescription& fontDescrip tion, float effectiveZoom, float specifiedSize)
532 { 530 {
533 float zoomFactor = 1.0f; 531 float zoomFactor = effectiveZoom;
534 if (!m_useSVGZoomRules) { 532
535 zoomFactor = effectiveZoom; 533 // FIXME: Why is this here!!!!?!
536 // FIXME: Why is this here!!!!?! 534 if (LocalFrame* frame = m_document->frame())
537 if (LocalFrame* frame = m_document->frame()) 535 zoomFactor *= frame->textZoomFactor();
538 zoomFactor *= frame->textZoomFactor();
539 }
540 536
541 return FontSize::getComputedSizeFromSpecifiedSize(m_document, zoomFactor, fo ntDescription.isAbsoluteSize(), specifiedSize); 537 return FontSize::getComputedSizeFromSpecifiedSize(m_document, zoomFactor, fo ntDescription.isAbsoluteSize(), specifiedSize);
542 } 538 }
543 539
544 static void getFontAndGlyphOrientation(const RenderStyle* style, FontOrientation & fontOrientation, NonCJKGlyphOrientation& glyphOrientation) 540 static void getFontAndGlyphOrientation(const RenderStyle* style, FontOrientation & fontOrientation, NonCJKGlyphOrientation& glyphOrientation)
545 { 541 {
546 if (style->isHorizontalWritingMode()) { 542 if (style->isHorizontalWritingMode()) {
547 fontOrientation = Horizontal; 543 fontOrientation = Horizontal;
548 glyphOrientation = NonCJKGlyphOrientationVerticalRight; 544 glyphOrientation = NonCJKGlyphOrientationVerticalRight;
549 return; 545 return;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 FontOrientation fontOrientation; 661 FontOrientation fontOrientation;
666 NonCJKGlyphOrientation glyphOrientation; 662 NonCJKGlyphOrientation glyphOrientation;
667 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation) ; 663 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation) ;
668 fontDescription.setOrientation(fontOrientation); 664 fontDescription.setOrientation(fontOrientation);
669 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); 665 fontDescription.setNonCJKGlyphOrientation(glyphOrientation);
670 documentStyle->setFontDescription(fontDescription); 666 documentStyle->setFontDescription(fontDescription);
671 documentStyle->font().update(fontSelector); 667 documentStyle->font().update(fontSelector);
672 } 668 }
673 669
674 } 670 }
OLDNEW
« no previous file with comments | « Source/core/css/resolver/FontBuilder.h ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698