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

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

Issue 308123010: Trigger computation of font size when crossing foreignObject boundary (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove use of useSVGZoomRules in FontBuilder and add a forced mode for when crossing the foreignObj… 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
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, FontBuilderOperation fontBuilderOperation)
73 { 72 {
74 ASSERT(document.frame()); 73 ASSERT(document.frame());
74 ASSERT(fontBuilderOperation == OnlyBuildFontOnChange || fontBuilderOperation == AlwaysBuildFont);
75 m_document = &document; 75 m_document = &document;
76 m_useSVGZoomRules = useSVGZoomRules;
77 m_style = style; 76 m_style = style;
78 m_fontDirty = false; 77 m_fontDirty = (fontBuilderOperation == AlwaysBuildFont);
79 } 78 }
80 79
81 inline static void setFontFamilyToStandard(FontDescription& fontDescription, con st Document* document) 80 inline static void setFontFamilyToStandard(FontDescription& fontDescription, con st Document* document)
82 { 81 {
83 if (!document || !document->settings()) 82 if (!document || !document->settings())
84 return; 83 return;
85 84
86 fontDescription.setGenericFamily(FontDescription::StandardFamily); 85 fontDescription.setGenericFamily(FontDescription::StandardFamily);
87 const AtomicString& standardFontFamily = document->settings()->genericFontFa milySettings().standard(); 86 const AtomicString& standardFontFamily = document->settings()->genericFontFa milySettings().standard();
88 if (standardFontFamily.isEmpty()) 87 if (standardFontFamily.isEmpty())
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 } 522 }
524 523
525 void FontBuilder::setSize(FontDescription& fontDescription, float effectiveZoom, float size) 524 void FontBuilder::setSize(FontDescription& fontDescription, float effectiveZoom, float size)
526 { 525 {
527 fontDescription.setSpecifiedSize(size); 526 fontDescription.setSpecifiedSize(size);
528 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescrip tion, effectiveZoom, size)); 527 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescrip tion, effectiveZoom, size));
529 } 528 }
530 529
531 float FontBuilder::getComputedSizeFromSpecifiedSize(FontDescription& fontDescrip tion, float effectiveZoom, float specifiedSize) 530 float FontBuilder::getComputedSizeFromSpecifiedSize(FontDescription& fontDescrip tion, float effectiveZoom, float specifiedSize)
532 { 531 {
533 float zoomFactor = 1.0f; 532 float zoomFactor = effectiveZoom;
534 if (!m_useSVGZoomRules) { 533 // FIXME: Why is this here!!!!?!
535 zoomFactor = effectiveZoom; 534 if (LocalFrame* frame = m_document->frame())
536 // FIXME: Why is this here!!!!?! 535 zoomFactor *= frame->textZoomFactor();
537 if (LocalFrame* frame = m_document->frame())
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

Powered by Google App Engine
This is Rietveld 408576698