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

Side by Side Diff: sky/engine/core/css/resolver/StyleResolver.cpp

Issue 710113003: Initial step of removing CSS zoom related properties. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 if (state.element()->inlineStyle()) { 373 if (state.element()->inlineStyle()) {
374 // Inline style is immutable as long as there is no CSSOM wrapper. 374 // Inline style is immutable as long as there is no CSSOM wrapper.
375 bool isInlineStyleCacheable = !state.element()->inlineStyle()->isMut able(); 375 bool isInlineStyleCacheable = !state.element()->inlineStyle()->isMut able();
376 collector.addElementStyleProperties(state.element()->inlineStyle(), isInlineStyleCacheable); 376 collector.addElementStyleProperties(state.element()->inlineStyle(), isInlineStyleCacheable);
377 } 377 }
378 } 378 }
379 } 379 }
380 380
381 PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document& document) 381 PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document& document)
382 { 382 {
383 const LocalFrame* frame = document.frame();
384
385 RefPtr<RenderStyle> documentStyle = RenderStyle::create(); 383 RefPtr<RenderStyle> documentStyle = RenderStyle::create();
386 documentStyle->setDisplay(BLOCK); 384 documentStyle->setDisplay(BLOCK);
387 documentStyle->setRTLOrdering(LogicalOrder); 385 documentStyle->setRTLOrdering(LogicalOrder);
388 documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1);
389 documentStyle->setLocale(document.contentLanguage()); 386 documentStyle->setLocale(document.contentLanguage());
390 documentStyle->setZIndex(0); 387 documentStyle->setZIndex(0);
391 documentStyle->setUserModify(READ_ONLY); 388 documentStyle->setUserModify(READ_ONLY);
392 389
393 document.setupFontBuilder(documentStyle.get()); 390 document.setupFontBuilder(documentStyle.get());
394 391
395 return documentStyle.release(); 392 return documentStyle.release();
396 } 393 }
397 394
398 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt trValues, RuleFeatureSet& features) 395 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt trValues, RuleFeatureSet& features)
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 // lastCSSPropertyId<HighPriorityProperties>. 713 // lastCSSPropertyId<HighPriorityProperties>.
717 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::HighPr iorityProperties>() 714 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::HighPr iorityProperties>()
718 { 715 {
719 COMPILE_ASSERT(CSSPropertyColor == firstCSSProperty, CSS_color_is_first_high _priority_property); 716 COMPILE_ASSERT(CSSPropertyColor == firstCSSProperty, CSS_color_is_first_high _priority_property);
720 return CSSPropertyColor; 717 return CSSPropertyColor;
721 } 718 }
722 719
723 // This method returns the last CSSPropertyId of high priority properties. 720 // This method returns the last CSSPropertyId of high priority properties.
724 template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::HighPri orityProperties>() 721 template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::HighPri orityProperties>()
725 { 722 {
726 COMPILE_ASSERT(CSSPropertyLineHeight == CSSPropertyColor + 17, CSS_line_heig ht_is_end_of_high_prioity_property_range); 723 COMPILE_ASSERT(CSSPropertyLineHeight == CSSPropertyColor + 16, CSS_line_heig ht_is_end_of_high_prioity_property_range);
727 COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyLineHeight - 1, CSS_zoom_is_bef ore_line_height); 724 COMPILE_ASSERT(CSSPropertyTextRendering == CSSPropertyLineHeight - 1, CSS_te xt_rendering_is_before_line_height);
728 return CSSPropertyLineHeight; 725 return CSSPropertyLineHeight;
729 } 726 }
730 727
731 // This method returns the first CSSPropertyId of remaining properties, 728 // This method returns the first CSSPropertyId of remaining properties,
732 // i.e. low priority properties. No properties depend on low priority 729 // i.e. low priority properties. No properties depend on low priority
733 // properties. So we don't need to resolve such properties quickly. 730 // properties. So we don't need to resolve such properties quickly.
734 // All low priority properties are obtained by using 731 // All low priority properties are obtained by using
735 // firstCSSPropertyId<LowPriorityProperties> and 732 // firstCSSPropertyId<LowPriorityProperties> and
736 // lastCSSPropertyId<LowPriorityProperties>. 733 // lastCSSPropertyId<LowPriorityProperties>.
737 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::LowPri orityProperties>() 734 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::LowPri orityProperties>()
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 visitor->trace(m_viewportDependentMediaQueryResults); 999 visitor->trace(m_viewportDependentMediaQueryResults);
1003 visitor->trace(m_features); 1000 visitor->trace(m_features);
1004 visitor->trace(m_attributeRuleSet); 1001 visitor->trace(m_attributeRuleSet);
1005 visitor->trace(m_styleSharingLists); 1002 visitor->trace(m_styleSharingLists);
1006 visitor->trace(m_pendingStyleSheets); 1003 visitor->trace(m_pendingStyleSheets);
1007 visitor->trace(m_document); 1004 visitor->trace(m_document);
1008 #endif 1005 #endif
1009 } 1006 }
1010 1007
1011 } // namespace blink 1008 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/resolver/StyleBuilderCustom.cpp ('k') | sky/engine/core/css/resolver/StyleResolverState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698