OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
8 * | 8 * |
9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
581 } else if (checkTypeThenUseCount(event, EventTypeNames::focusin, UseCounter: :FocusInOutEvent)) { | 581 } else if (checkTypeThenUseCount(event, EventTypeNames::focusin, UseCounter: :FocusInOutEvent)) { |
582 } else if (checkTypeThenUseCount(event, EventTypeNames::focusout, UseCounter ::FocusInOutEvent)) { | 582 } else if (checkTypeThenUseCount(event, EventTypeNames::focusout, UseCounter ::FocusInOutEvent)) { |
583 } else if (checkTypeThenUseCount(event, EventTypeNames::textInput, UseCounte r::TextInputFired)) { | 583 } else if (checkTypeThenUseCount(event, EventTypeNames::textInput, UseCounte r::TextInputFired)) { |
584 } else if (checkTypeThenUseCount(event, EventTypeNames::touchstart, UseCount er::TouchStartFired)) { | 584 } else if (checkTypeThenUseCount(event, EventTypeNames::touchstart, UseCount er::TouchStartFired)) { |
585 } else if (checkTypeThenUseCount(event, EventTypeNames::mousedown, UseCounte r::MouseDownFired)) { | 585 } else if (checkTypeThenUseCount(event, EventTypeNames::mousedown, UseCounte r::MouseDownFired)) { |
586 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerdown, UseCoun ter::PointerDownFired)) { | 586 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerdown, UseCoun ter::PointerDownFired)) { |
587 if (LocalDOMWindow* executingWindow = this->executingWindow()) { | 587 if (LocalDOMWindow* executingWindow = this->executingWindow()) { |
588 if (event->isPointerEvent() && static_cast<PointerEvent*>(event)->po interType() == "touch") | 588 if (event->isPointerEvent() && static_cast<PointerEvent*>(event)->po interType() == "touch") |
589 UseCounter::count(executingWindow->document(), UseCounter::Point erDownFiredForTouch); | 589 UseCounter::count(executingWindow->document(), UseCounter::Point erDownFiredForTouch); |
590 } | 590 } |
591 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerenter, UseCou nter::PointerEnterLeaveFired) | |
592 || checkTypeThenUseCount(event, EventTypeNames::pointerleave, UseCounter ::PointerEnterLeaveFired)) { | |
593 LocalDOMWindow* executingWindow = this->executingWindow(); | |
594 Node* node = toNode(); | |
595 if (executingWindow && node && node->getNodeType() == Node::kElementNode && event->isPointerEvent()) { | |
596 const Element* element = static_cast<Element*>(node); | |
597 const PointerEvent* pointerEvent = static_cast<PointerEvent*>(event) ; | |
598 if (element->hasPointerCapture(pointerEvent->pointerId())) | |
599 UseCounter::count(executingWindow->document(), UseCounter::Point erEnterLeaveFiredWhileCaptured); | |
600 } | |
601 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerover, UseCoun ter::PointerOverOutFired) | |
dtapuska
2016/08/24 20:20:57
This is duplicated code; can we parameterize this
mustaq
2016/08/24 20:50:28
Done.
| |
602 || checkTypeThenUseCount(event, EventTypeNames::pointerout, UseCounter:: PointerOverOutFired)) { | |
603 LocalDOMWindow* executingWindow = this->executingWindow(); | |
604 Node* node = toNode(); | |
605 if (executingWindow && node && node->getNodeType() == Node::kElementNode && event->isPointerEvent()) { | |
606 const Element* element = static_cast<Element*>(node); | |
607 const PointerEvent* pointerEvent = static_cast<PointerEvent*>(event) ; | |
608 if (element->hasPointerCapture(pointerEvent->pointerId())) | |
609 UseCounter::count(executingWindow->document(), UseCounter::Point erOverOutFiredWhileCaptured); | |
610 } | |
591 } | 611 } |
592 | 612 |
593 ExecutionContext* context = getExecutionContext(); | 613 ExecutionContext* context = getExecutionContext(); |
594 if (!context) | 614 if (!context) |
595 return false; | 615 return false; |
596 | 616 |
597 size_t i = 0; | 617 size_t i = 0; |
598 size_t size = entry.size(); | 618 size_t size = entry.size(); |
599 if (!d->firingEventIterators) | 619 if (!d->firingEventIterators) |
600 d->firingEventIterators = wrapUnique(new FiringEventIteratorVector); | 620 d->firingEventIterators = wrapUnique(new FiringEventIteratorVector); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
697 // they have one less listener to invoke. | 717 // they have one less listener to invoke. |
698 if (d->firingEventIterators) { | 718 if (d->firingEventIterators) { |
699 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { | 719 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { |
700 d->firingEventIterators->at(i).iterator = 0; | 720 d->firingEventIterators->at(i).iterator = 0; |
701 d->firingEventIterators->at(i).end = 0; | 721 d->firingEventIterators->at(i).end = 0; |
702 } | 722 } |
703 } | 723 } |
704 } | 724 } |
705 | 725 |
706 } // namespace blink | 726 } // namespace blink |
OLD | NEW |