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

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

Issue 18371008: Add a WebDocument::watchCssSelectors(selectors) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Fix most comments; TODO benchmark and use Element::recalcStyle Created 7 years, 5 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 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. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #include "core/css/ShadowValue.h" 77 #include "core/css/ShadowValue.h"
78 #include "core/css/StylePropertySet.h" 78 #include "core/css/StylePropertySet.h"
79 #include "core/css/StylePropertyShorthand.h" 79 #include "core/css/StylePropertyShorthand.h"
80 #include "core/css/StyleSheetContents.h" 80 #include "core/css/StyleSheetContents.h"
81 #include "core/css/resolver/ElementStyleResources.h" 81 #include "core/css/resolver/ElementStyleResources.h"
82 #include "core/css/resolver/FilterOperationResolver.h" 82 #include "core/css/resolver/FilterOperationResolver.h"
83 #include "core/css/resolver/StyleResolver.h" 83 #include "core/css/resolver/StyleResolver.h"
84 #include "core/css/resolver/StyleResolverState.h" 84 #include "core/css/resolver/StyleResolverState.h"
85 #include "core/css/resolver/TransformBuilder.h" 85 #include "core/css/resolver/TransformBuilder.h"
86 #include "core/css/resolver/ViewportStyleResolver.h" 86 #include "core/css/resolver/ViewportStyleResolver.h"
87 #include "core/dom/CSSSelectorWatch.h"
87 #include "core/dom/DocumentStyleSheetCollection.h" 88 #include "core/dom/DocumentStyleSheetCollection.h"
88 #include "core/dom/Text.h" 89 #include "core/dom/Text.h"
89 #include "core/dom/shadow/ShadowRoot.h" 90 #include "core/dom/shadow/ShadowRoot.h"
90 #include "core/page/Frame.h" 91 #include "core/page/Frame.h"
91 #include "core/page/FrameView.h" 92 #include "core/page/FrameView.h"
92 #include "core/page/Page.h" 93 #include "core/page/Page.h"
93 #include "core/page/Settings.h" 94 #include "core/page/Settings.h"
94 #include "core/platform/LinkHash.h" 95 #include "core/platform/LinkHash.h"
95 #include "core/platform/graphics/FontDescription.h" 96 #include "core/platform/graphics/FontDescription.h"
96 #include "core/platform/graphics/filters/custom/CustomFilterConstants.h" 97 #include "core/platform/graphics/filters/custom/CustomFilterConstants.h"
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 } 1701 }
1701 case CSSPropertyWebkitTapHighlightColor: { 1702 case CSSPropertyWebkitTapHighlightColor: {
1702 HANDLE_INHERIT_AND_INITIAL(tapHighlightColor, TapHighlightColor); 1703 HANDLE_INHERIT_AND_INITIAL(tapHighlightColor, TapHighlightColor);
1703 if (!primitiveValue) 1704 if (!primitiveValue)
1704 break; 1705 break;
1705 1706
1706 Color col = state.document()->textLinkColors().colorFromPrimitiveValue(p rimitiveValue, state.style()->visitedDependentColor(CSSPropertyColor)); 1707 Color col = state.document()->textLinkColors().colorFromPrimitiveValue(p rimitiveValue, state.style()->visitedDependentColor(CSSPropertyColor));
1707 state.style()->setTapHighlightColor(col); 1708 state.style()->setTapHighlightColor(col);
1708 return; 1709 return;
1709 } 1710 }
1711 case CSSPropertyInternalCallback: {
1712 if (isInherit || isInitial)
1713 return;
1714 if (primitiveValue) {
1715 switch (primitiveValue->getValueID()) {
1716 case CSSValueInternalPresence:
1717 state.style()->addCallbackSelector(
1718 state.rule()->selectorList().selectorsText(),
esprehn 2013/07/17 07:14:32 This dynamically recreates the text of the selecto
Jeffrey Yasskin 2013/08/02 01:34:07 Right, but the "div" case didn't show up as signif
1719 CSSSelectorWatch::from(state.element()->document()));
esprehn 2013/07/17 07:14:32 The hash table lookup hiding in here is going to h
Jeffrey Yasskin 2013/08/02 01:34:07 A hash table lookup is generally cheaper than an a
1720 return;
1721 default:
1722 break;
1723 }
1724 }
1725 break;
1726 }
1710 case CSSPropertyInvalid: 1727 case CSSPropertyInvalid:
1711 return; 1728 return;
1712 // Directional properties are resolved by resolveDirectionAwareProperty() be fore the switch. 1729 // Directional properties are resolved by resolveDirectionAwareProperty() be fore the switch.
1713 case CSSPropertyWebkitBorderEndColor: 1730 case CSSPropertyWebkitBorderEndColor:
1714 case CSSPropertyWebkitBorderEndStyle: 1731 case CSSPropertyWebkitBorderEndStyle:
1715 case CSSPropertyWebkitBorderEndWidth: 1732 case CSSPropertyWebkitBorderEndWidth:
1716 case CSSPropertyWebkitBorderStartColor: 1733 case CSSPropertyWebkitBorderStartColor:
1717 case CSSPropertyWebkitBorderStartStyle: 1734 case CSSPropertyWebkitBorderStartStyle:
1718 case CSSPropertyWebkitBorderStartWidth: 1735 case CSSPropertyWebkitBorderStartWidth:
1719 case CSSPropertyWebkitBorderBeforeColor: 1736 case CSSPropertyWebkitBorderBeforeColor:
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
2554 case CSSPropertyMaskType: { 2571 case CSSPropertyMaskType: {
2555 HANDLE_SVG_INHERIT_AND_INITIAL(maskType, MaskType) 2572 HANDLE_SVG_INHERIT_AND_INITIAL(maskType, MaskType)
2556 if (primitiveValue) 2573 if (primitiveValue)
2557 state.style()->accessSVGStyle()->setMaskType(*primitiveValue); 2574 state.style()->accessSVGStyle()->setMaskType(*primitiveValue);
2558 break; 2575 break;
2559 } 2576 }
2560 } 2577 }
2561 } 2578 }
2562 2579
2563 } // namespace WebCore 2580 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698