OLD | NEW |
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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 588 |
589 bool DOMWindow::isCurrentlyDisplayedInFrame() const | 589 bool DOMWindow::isCurrentlyDisplayedInFrame() const |
590 { | 590 { |
591 return m_frame && m_frame->domWindow() == this && m_frame->host(); | 591 return m_frame && m_frame->domWindow() == this && m_frame->host(); |
592 } | 592 } |
593 | 593 |
594 int DOMWindow::orientation() const | 594 int DOMWindow::orientation() const |
595 { | 595 { |
596 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); | 596 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); |
597 | 597 |
598 UseCounter::count(document(), UseCounter::WindowOrientation); | |
599 | |
600 if (!m_frame) | 598 if (!m_frame) |
601 return 0; | 599 return 0; |
602 | 600 |
603 return m_frame->orientation(); | 601 return m_frame->orientation(); |
604 } | 602 } |
605 | 603 |
606 Screen& DOMWindow::screen() const | 604 Screen& DOMWindow::screen() const |
607 { | 605 { |
608 if (!m_screen) | 606 if (!m_screen) |
609 m_screen = Screen::create(m_frame); | 607 m_screen = Screen::create(m_frame); |
610 return *m_screen; | 608 return *m_screen; |
611 } | 609 } |
612 | 610 |
613 History& DOMWindow::history() const | 611 History& DOMWindow::history() const |
614 { | 612 { |
615 if (!m_history) | 613 if (!m_history) |
616 m_history = History::create(m_frame); | 614 m_history = History::create(m_frame); |
617 return *m_history; | 615 return *m_history; |
618 } | 616 } |
619 | 617 |
620 BarProp& DOMWindow::locationbar() const | 618 BarProp& DOMWindow::locationbar() const |
621 { | 619 { |
622 UseCounter::count(document(), UseCounter::BarPropLocationbar); | |
623 if (!m_locationbar) | 620 if (!m_locationbar) |
624 m_locationbar = BarProp::create(m_frame, BarProp::Locationbar); | 621 m_locationbar = BarProp::create(m_frame, BarProp::Locationbar); |
625 return *m_locationbar; | 622 return *m_locationbar; |
626 } | 623 } |
627 | 624 |
628 BarProp& DOMWindow::menubar() const | 625 BarProp& DOMWindow::menubar() const |
629 { | 626 { |
630 UseCounter::count(document(), UseCounter::BarPropMenubar); | |
631 if (!m_menubar) | 627 if (!m_menubar) |
632 m_menubar = BarProp::create(m_frame, BarProp::Menubar); | 628 m_menubar = BarProp::create(m_frame, BarProp::Menubar); |
633 return *m_menubar; | 629 return *m_menubar; |
634 } | 630 } |
635 | 631 |
636 BarProp& DOMWindow::personalbar() const | 632 BarProp& DOMWindow::personalbar() const |
637 { | 633 { |
638 UseCounter::count(document(), UseCounter::BarPropPersonalbar); | |
639 if (!m_personalbar) | 634 if (!m_personalbar) |
640 m_personalbar = BarProp::create(m_frame, BarProp::Personalbar); | 635 m_personalbar = BarProp::create(m_frame, BarProp::Personalbar); |
641 return *m_personalbar; | 636 return *m_personalbar; |
642 } | 637 } |
643 | 638 |
644 BarProp& DOMWindow::scrollbars() const | 639 BarProp& DOMWindow::scrollbars() const |
645 { | 640 { |
646 UseCounter::count(document(), UseCounter::BarPropScrollbars); | |
647 if (!m_scrollbars) | 641 if (!m_scrollbars) |
648 m_scrollbars = BarProp::create(m_frame, BarProp::Scrollbars); | 642 m_scrollbars = BarProp::create(m_frame, BarProp::Scrollbars); |
649 return *m_scrollbars; | 643 return *m_scrollbars; |
650 } | 644 } |
651 | 645 |
652 BarProp& DOMWindow::statusbar() const | 646 BarProp& DOMWindow::statusbar() const |
653 { | 647 { |
654 UseCounter::count(document(), UseCounter::BarPropStatusbar); | |
655 if (!m_statusbar) | 648 if (!m_statusbar) |
656 m_statusbar = BarProp::create(m_frame, BarProp::Statusbar); | 649 m_statusbar = BarProp::create(m_frame, BarProp::Statusbar); |
657 return *m_statusbar; | 650 return *m_statusbar; |
658 } | 651 } |
659 | 652 |
660 BarProp& DOMWindow::toolbar() const | 653 BarProp& DOMWindow::toolbar() const |
661 { | 654 { |
662 UseCounter::count(document(), UseCounter::BarPropToolbar); | |
663 if (!m_toolbar) | 655 if (!m_toolbar) |
664 m_toolbar = BarProp::create(m_frame, BarProp::Toolbar); | 656 m_toolbar = BarProp::create(m_frame, BarProp::Toolbar); |
665 return *m_toolbar; | 657 return *m_toolbar; |
666 } | 658 } |
667 | 659 |
668 Console& DOMWindow::console() const | 660 Console& DOMWindow::console() const |
669 { | 661 { |
670 if (!m_console) | 662 if (!m_console) |
671 m_console = Console::create(m_frame); | 663 m_console = Console::create(m_frame); |
672 return *m_console; | 664 return *m_console; |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 PassRefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* elt, const
String& pseudoElt) const | 1273 PassRefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* elt, const
String& pseudoElt) const |
1282 { | 1274 { |
1283 if (!elt) | 1275 if (!elt) |
1284 return nullptr; | 1276 return nullptr; |
1285 | 1277 |
1286 return CSSComputedStyleDeclaration::create(elt, false, pseudoElt); | 1278 return CSSComputedStyleDeclaration::create(elt, false, pseudoElt); |
1287 } | 1279 } |
1288 | 1280 |
1289 PassRefPtrWillBeRawPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* eleme
nt, const String& pseudoElement) const | 1281 PassRefPtrWillBeRawPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* eleme
nt, const String& pseudoElement) const |
1290 { | 1282 { |
1291 UseCounter::count(document(), UseCounter::GetMatchedCSSRules); | |
1292 if (!element) | 1283 if (!element) |
1293 return nullptr; | 1284 return nullptr; |
1294 | 1285 |
1295 if (!isCurrentlyDisplayedInFrame()) | 1286 if (!isCurrentlyDisplayedInFrame()) |
1296 return nullptr; | 1287 return nullptr; |
1297 | 1288 |
1298 unsigned colonStart = pseudoElement[0] == ':' ? (pseudoElement[1] == ':' ? 2
: 1) : 0; | 1289 unsigned colonStart = pseudoElement[0] == ':' ? (pseudoElement[1] == ':' ? 2
: 1) : 0; |
1299 CSSSelector::PseudoType pseudoType = CSSSelector::parsePseudoType(AtomicStri
ng(pseudoElement.substring(colonStart))); | 1290 CSSSelector::PseudoType pseudoType = CSSSelector::parsePseudoType(AtomicStri
ng(pseudoElement.substring(colonStart))); |
1300 if (pseudoType == CSSSelector::PseudoUnknown && !pseudoElement.isEmpty()) | 1291 if (pseudoType == CSSSelector::PseudoUnknown && !pseudoElement.isEmpty()) |
1301 return nullptr; | 1292 return nullptr; |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1871 visitor->trace(m_media); | 1862 visitor->trace(m_media); |
1872 visitor->trace(m_sessionStorage); | 1863 visitor->trace(m_sessionStorage); |
1873 visitor->trace(m_localStorage); | 1864 visitor->trace(m_localStorage); |
1874 visitor->trace(m_applicationCache); | 1865 visitor->trace(m_applicationCache); |
1875 visitor->trace(m_performance); | 1866 visitor->trace(m_performance); |
1876 visitor->trace(m_css); | 1867 visitor->trace(m_css); |
1877 WillBeHeapSupplementable<DOMWindow>::trace(visitor); | 1868 WillBeHeapSupplementable<DOMWindow>::trace(visitor); |
1878 } | 1869 } |
1879 | 1870 |
1880 } // namespace WebCore | 1871 } // namespace WebCore |
OLD | NEW |