1926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)/* 2926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * Copyright (C) 2012 Intel Corporation. All rights reserved. 3926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * 4926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * Redistribution and use in source and binary forms, with or without 5926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * modification, are permitted provided that the following conditions 6926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * are met: 7926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * 8926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * 1. Redistributions of source code must retain the above 9926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * copyright notice, this list of conditions and the following 10926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * disclaimer. 11926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * 2. Redistributions in binary form must reproduce the above 12926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * copyright notice, this list of conditions and the following 13926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * disclaimer in the documentation and/or other materials 14926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * provided with the distribution. 15926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * 16926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY 17926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE 20926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 25926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 26926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * SUCH DAMAGE. 28926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) */ 29926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 30926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)#ifndef ViewportStyleResolver_h 31926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)#define ViewportStyleResolver_h 32926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 335d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)#include "core/CSSPropertyNames.h" 341e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "core/css/RuleSet.h" 35bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)#include "platform/Length.h" 3681a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles)#include "wtf/RefCounted.h" 3781a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles)#include "wtf/RefPtr.h" 38926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 39c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink { 40926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 41926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)class Document; 4293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class MutableStylePropertySet; 43926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)class StyleRuleViewport; 44926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 4507a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdochclass ViewportStyleResolver : public NoBaseWillBeGarbageCollected<ViewportStyleResolver> { 4643e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ViewportStyleResolver); 47926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)public: 4807a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch static PassOwnPtrWillBeRawPtr<ViewportStyleResolver> create(Document* document) 49926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) { 5007a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch return adoptPtrWillBeNoop(new ViewportStyleResolver(document)); 51926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) } 52926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 531e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) enum Origin { UserAgentOrigin, AuthorOrigin }; 541e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) 551e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) void collectViewportRules(RuleSet*, Origin); 56926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 57926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) void resolve(); 58926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 5943e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) void trace(Visitor*); 6043e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) 61926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)private: 62926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) explicit ViewportStyleResolver(Document*); 63926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 641e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) void addViewportRule(StyleRuleViewport*, Origin); 651e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) 668abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) float viewportArgumentValue(CSSPropertyID) const; 678abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) Length viewportLengthValue(CSSPropertyID) const; 68926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 69c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) RawPtrWillBeMember<Document> m_document; 7043e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) RefPtrWillBeMember<MutableStylePropertySet> m_propertySet; 718abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) bool m_hasAuthorStyle; 72926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}; 73926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 74c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)} // namespace blink 75926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 76926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)#endif // ViewportStyleResolver_h 77