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

Side by Side Diff: sky/engine/core/frame/LocalDOMWindow.cpp

Issue 772363002: Remove code to collect rules when matching. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « sky/engine/core/frame/LocalDOMWindow.h ('k') | sky/engine/core/frame/UseCounter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 } 591 }
592 592
593 PassRefPtr<CSSStyleDeclaration> LocalDOMWindow::getComputedStyle(Element* elt, c onst String& pseudoElt) const 593 PassRefPtr<CSSStyleDeclaration> LocalDOMWindow::getComputedStyle(Element* elt, c onst String& pseudoElt) const
594 { 594 {
595 if (!elt) 595 if (!elt)
596 return nullptr; 596 return nullptr;
597 597
598 return CSSComputedStyleDeclaration::create(elt, false, pseudoElt); 598 return CSSComputedStyleDeclaration::create(elt, false, pseudoElt);
599 } 599 }
600 600
601 PassRefPtr<CSSRuleList> LocalDOMWindow::getMatchedCSSRules(Element* element, con st String& pseudoElement) const
602 {
603 if (!element)
604 return nullptr;
605
606 unsigned colonStart = pseudoElement[0] == ':' ? (pseudoElement[1] == ':' ? 2 : 1) : 0;
607 CSSSelector::PseudoType pseudoType = CSSSelector::parsePseudoType(AtomicStri ng(pseudoElement.substring(colonStart)));
608 if (pseudoType == CSSSelector::PseudoUnknown && !pseudoElement.isEmpty())
609 return nullptr;
610
611 unsigned rulesToInclude = StyleResolver::AuthorCSSRules;
612 PseudoId pseudoId = CSSSelector::pseudoId(pseudoType);
613 return m_frame->document()->ensureStyleResolver().pseudoCSSRulesForElement(e lement, pseudoId, rulesToInclude);
614 }
615
616 double LocalDOMWindow::devicePixelRatio() const 601 double LocalDOMWindow::devicePixelRatio() const
617 { 602 {
618 if (!m_frame) 603 if (!m_frame)
619 return 0.0; 604 return 0.0;
620 605
621 return m_frame->devicePixelRatio(); 606 return m_frame->devicePixelRatio();
622 } 607 }
623 608
624 void LocalDOMWindow::moveBy(float x, float y) const 609 void LocalDOMWindow::moveBy(float x, float y) const
625 { 610 {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 { 782 {
798 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWin dow>::lifecycleNotifier()); 783 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWin dow>::lifecycleNotifier());
799 } 784 }
800 785
801 PassOwnPtr<LifecycleNotifier<LocalDOMWindow> > LocalDOMWindow::createLifecycleNo tifier() 786 PassOwnPtr<LifecycleNotifier<LocalDOMWindow> > LocalDOMWindow::createLifecycleNo tifier()
802 { 787 {
803 return DOMWindowLifecycleNotifier::create(this); 788 return DOMWindowLifecycleNotifier::create(this);
804 } 789 }
805 790
806 } // namespace blink 791 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/frame/LocalDOMWindow.h ('k') | sky/engine/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698