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

Side by Side Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 18371008: Add a WebDocument::watchCssSelectors(selectors) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Initial 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) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. 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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 return; 684 return;
685 rareInheritedData.access()->quotes = q; 685 rareInheritedData.access()->quotes = q;
686 } 686 }
687 687
688 void RenderStyle::clearCursorList() 688 void RenderStyle::clearCursorList()
689 { 689 {
690 if (rareInheritedData->cursorData) 690 if (rareInheritedData->cursorData)
691 rareInheritedData.access()->cursorData = 0; 691 rareInheritedData.access()->cursorData = 0;
692 } 692 }
693 693
694 #if ENABLE(CSS_CALLBACKS)
695 void RenderStyle::addCallbackSelector(const String& selector, Document* document )
696 {
697 ASSERT(!rareNonInheritedData->m_document.get()
698 || rareNonInheritedData->m_document.get() == document);
699 if (!rareNonInheritedData->m_callbackSelectors.contains(selector)) {
700 StyleRareNonInheritedData* data = rareNonInheritedData.access();
701 data->m_callbackSelectors.append(selector);
702 // Assigns a WeakPtr to |document| to data->m_document.
703 document->addSelectorMatch(selector, data);
704 }
705 }
706
707 void RenderStyle::removeCallbackSelector(const String& selector)
708 {
709 size_t index = rareNonInheritedData->m_callbackSelectors.find(selector);
710 if (index != notFound) {
711 rareNonInheritedData.access()->m_callbackSelectors.remove(index);
712 if (Document* document = rareNonInheritedData->m_document.get())
713 document->removeSelectorMatch(selector);
714 }
715 }
716 #endif
717
694 void RenderStyle::clearContent() 718 void RenderStyle::clearContent()
695 { 719 {
696 if (rareNonInheritedData->m_content) 720 if (rareNonInheritedData->m_content)
697 rareNonInheritedData.access()->m_content = nullptr; 721 rareNonInheritedData.access()->m_content = nullptr;
698 } 722 }
699 723
700 void RenderStyle::appendContent(PassOwnPtr<ContentData> contentData) 724 void RenderStyle::appendContent(PassOwnPtr<ContentData> contentData)
701 { 725 {
702 OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content; 726 OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content;
703 ContentData* lastContent = content.get(); 727 ContentData* lastContent = content.get();
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 info.addMember(rareInheritedData, "rareInheritedData"); 1596 info.addMember(rareInheritedData, "rareInheritedData");
1573 // FIXME: inherited contains StyleImage and Font fields that might need to b e instrumented. 1597 // FIXME: inherited contains StyleImage and Font fields that might need to b e instrumented.
1574 info.addMember(inherited, "inherited"); 1598 info.addMember(inherited, "inherited");
1575 info.addMember(m_cachedPseudoStyles, "cachedPseudoStyles"); 1599 info.addMember(m_cachedPseudoStyles, "cachedPseudoStyles");
1576 info.addMember(m_svgStyle, "svgStyle"); 1600 info.addMember(m_svgStyle, "svgStyle");
1577 info.addMember(inherited_flags, "inherited_flags"); 1601 info.addMember(inherited_flags, "inherited_flags");
1578 info.addMember(noninherited_flags, "noninherited_flags"); 1602 info.addMember(noninherited_flags, "noninherited_flags");
1579 } 1603 }
1580 1604
1581 } // namespace WebCore 1605 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/style/RenderStyle.h ('k') | Source/core/rendering/style/StyleRareNonInheritedData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698