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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 2878333002: Make ETextModify an enum class. (Closed)
Patch Set: Created 3 years, 7 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 * (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. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 : EOrder::kLogical); 559 : EOrder::kLogical);
560 document_style->SetZoom( 560 document_style->SetZoom(
561 frame && !document.Printing() ? frame->PageZoomFactor() : 1); 561 frame && !document.Printing() ? frame->PageZoomFactor() : 1);
562 FontDescription document_font_description = 562 FontDescription document_font_description =
563 document_style->GetFontDescription(); 563 document_style->GetFontDescription();
564 document_font_description.SetLocale( 564 document_font_description.SetLocale(
565 LayoutLocale::Get(document.ContentLanguage())); 565 LayoutLocale::Get(document.ContentLanguage()));
566 document_style->SetFontDescription(document_font_description); 566 document_style->SetFontDescription(document_font_description);
567 document_style->SetZIndex(0); 567 document_style->SetZIndex(0);
568 document_style->SetIsStackingContext(true); 568 document_style->SetIsStackingContext(true);
569 document_style->SetUserModify(document.InDesignMode() ? READ_WRITE 569 document_style->SetUserModify(document.InDesignMode()
570 : READ_ONLY); 570 ? EUserModify::kReadWrite
571 : EUserModify::kReadOnly);
571 // These are designed to match the user-agent stylesheet values for the 572 // These are designed to match the user-agent stylesheet values for the
572 // document element so that the common case doesn't need to create a new 573 // document element so that the common case doesn't need to create a new
573 // ComputedStyle in Document::InheritHtmlAndBodyElementStyles. 574 // ComputedStyle in Document::InheritHtmlAndBodyElementStyles.
574 document_style->SetDisplay(EDisplay::kBlock); 575 document_style->SetDisplay(EDisplay::kBlock);
575 document_style->SetPosition(EPosition::kAbsolute); 576 document_style->SetPosition(EPosition::kAbsolute);
576 577
577 // Document::InheritHtmlAndBodyElementStyles will set the final overflow 578 // Document::InheritHtmlAndBodyElementStyles will set the final overflow
578 // style values, but they should initially be auto to avoid premature 579 // style values, but they should initially be auto to avoid premature
579 // scrollbar removal in PaintLayerScrollableArea::UpdateAfterStyleChange. 580 // scrollbar removal in PaintLayerScrollableArea::UpdateAfterStyleChange.
580 document_style->SetOverflowX(EOverflow::kAuto); 581 document_style->SetOverflowX(EOverflow::kAuto);
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1701 // earlier style object built using the same exact style declarations. We 1702 // earlier style object built using the same exact style declarations. We
1702 // then only need to apply the inherited properties, if any, as their values 1703 // then only need to apply the inherited properties, if any, as their values
1703 // can depend on the element context. This is fast and saves memory by 1704 // can depend on the element context. This is fast and saves memory by
1704 // reusing the style data structures. 1705 // reusing the style data structures.
1705 state.Style()->CopyNonInheritedFromCached( 1706 state.Style()->CopyNonInheritedFromCached(
1706 *cached_matched_properties->computed_style); 1707 *cached_matched_properties->computed_style);
1707 if (state.ParentStyle()->InheritedDataShared( 1708 if (state.ParentStyle()->InheritedDataShared(
1708 *cached_matched_properties->parent_computed_style) && 1709 *cached_matched_properties->parent_computed_style) &&
1709 !IsAtShadowBoundary(element) && 1710 !IsAtShadowBoundary(element) &&
1710 (!state.DistributedToInsertionPoint() || 1711 (!state.DistributedToInsertionPoint() ||
1711 state.Style()->UserModify() == READ_ONLY)) { 1712 state.Style()->UserModify() == EUserModify::kReadOnly)) {
1712 INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(), 1713 INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(),
1713 matched_property_cache_inherited_hit, 1); 1714 matched_property_cache_inherited_hit, 1);
1714 1715
1715 EInsideLink link_status = state.Style()->InsideLink(); 1716 EInsideLink link_status = state.Style()->InsideLink();
1716 // If the cache item parent style has identical inherited properties to 1717 // If the cache item parent style has identical inherited properties to
1717 // the current parent style then the resulting style will be identical 1718 // the current parent style then the resulting style will be identical
1718 // too. We copy the inherited properties over from the cache and are done. 1719 // too. We copy the inherited properties over from the cache and are done.
1719 state.Style()->InheritFrom(*cached_matched_properties->computed_style); 1720 state.Style()->InheritFrom(*cached_matched_properties->computed_style);
1720 1721
1721 // Unfortunately the link status is treated like an inherited property. We 1722 // Unfortunately the link status is treated like an inherited property. We
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 2035
2035 DEFINE_TRACE(StyleResolver) { 2036 DEFINE_TRACE(StyleResolver) {
2036 visitor->Trace(matched_properties_cache_); 2037 visitor->Trace(matched_properties_cache_);
2037 visitor->Trace(selector_filter_); 2038 visitor->Trace(selector_filter_);
2038 visitor->Trace(style_sharing_lists_); 2039 visitor->Trace(style_sharing_lists_);
2039 visitor->Trace(document_); 2040 visitor->Trace(document_);
2040 visitor->Trace(tracker_); 2041 visitor->Trace(tracker_);
2041 } 2042 }
2042 2043
2043 } // namespace blink 2044 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698