Changeset 166277 in webkit


Ignore:
Timestamp:
Mar 25, 2014 7:30:27 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

When the mouse is upped after dragged out of shadowDOM, it should lose :active.
https://bugs.webkit.org/show_bug.cgi?id=130660

Patch by Sanghyup Lee <sh53.lee@samsung.com> on 2014-03-25
Reviewed by Darin Adler.

Source/WebCore:

This caused a regression after r165037.
When we have to clear :active style of shadow DOM, we should clear host's style.
This patch replaces parentElement() by parentOrShadowHostElement().

  • dom/Document.cpp:

(WebCore::Document::updateHoverActiveState):

LayoutTests:

  • fast/css/hover-active-drag-expected.txt: Added a test for textarea.
  • fast/css/hover-active-drag.html: Updated.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r166263 r166277  
     12014-03-25  Sanghyup Lee  <sh53.lee@samsung.com>
     2
     3        When the mouse is upped after dragged out of shadowDOM, it should lose :active.
     4        https://bugs.webkit.org/show_bug.cgi?id=130660
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/css/hover-active-drag-expected.txt: Added a test for textarea.
     9        * fast/css/hover-active-drag.html: Updated.
     10
    1112014-03-25  Filip Pizlo  <fpizlo@apple.com>
    212
  • trunk/LayoutTests/fast/css/hover-active-drag-expected.txt

    r102632 r166277  
     1
    12Dragging out of an element should cause it to lose :hover
    23
     
    1314PASS background is "rgb(0, 0, 0)"
    1415PASS background is "rgb(0, 0, 0)"
     16PASS background is "rgb(255, 0, 0)"
     17PASS background is "rgb(255, 255, 0)"
     18PASS background is "rgb(0, 255, 0)"
     19PASS background is "rgb(0, 0, 0)"
    1520
    1621
  • trunk/LayoutTests/fast/css/hover-active-drag.html

    r155263 r166277  
    11<!DOCTYPE html>
    22<style>
    3   div { background: rgb(0, 0, 0); }
    4   div:hover { background: rgb(255, 0, 0); }
    5   div:hover:active { background: rgb(255, 255, 0); }
    6   div:active { background: rgb(0, 255, 0); }
    7   div {
     3  div, textarea { background: rgb(0, 0, 0); }
     4  div:hover, textarea:hover { background: rgb(255, 0, 0); }
     5  div:hover:active, textarea:hover:active { background: rgb(255, 255, 0); }
     6  div:active, textarea:active { background: rgb(0, 255, 0); }
     7  div, textarea {
    88    width: 100px;
    99    height: 100px;
     
    1515  <div id="box"></div>
    1616  <div id="box2"></div>
     17  <textarea id="textarea"></textarea>
    1718  <pre id="description"></div>
    1819  <pre id="console"></pre>
     
    6061    shouldHaveBackground(box, 'rgb(0, 0, 0)')
    6162    shouldHaveBackground(box2, 'rgb(0, 0, 0)')
     63
     64    // Move into the textarea.
     65    eventSender.mouseMoveTo(50, 250)
     66    shouldHaveBackground(textarea, 'rgb(255, 0, 0)')
     67
     68    eventSender.mouseDown()
     69    shouldHaveBackground(textarea, 'rgb(255, 255, 0)')
     70
     71    eventSender.mouseMoveTo(400, 250)
     72    shouldHaveBackground(textarea, 'rgb(0, 255, 0)')
     73
     74    eventSender.mouseUp()
     75    shouldHaveBackground(textarea, 'rgb(0, 0, 0)')
    6276  }
    6377</script>
  • trunk/Source/WebCore/ChangeLog

    r166274 r166277  
     12014-03-25  Sanghyup Lee  <sh53.lee@samsung.com>
     2
     3        When the mouse is upped after dragged out of shadowDOM, it should lose :active.
     4        https://bugs.webkit.org/show_bug.cgi?id=130660
     5
     6        Reviewed by Darin Adler.
     7
     8        This caused a regression after r165037.
     9        When we have to clear :active style of shadow DOM, we should clear host's style.
     10        This patch replaces parentElement() by parentOrShadowHostElement().
     11
     12        * dom/Document.cpp:
     13        (WebCore::Document::updateHoverActiveState):
     14
    1152014-03-25  Eric Carlson  <eric.carlson@apple.com>
    216
  • trunk/Source/WebCore/dom/Document.cpp

    r166144 r166277  
    58425842    if (oldActiveElement && !request.active()) {
    58435843        // We are clearing the :active chain because the mouse has been released.
    5844         for (Element* curr = oldActiveElement; curr; curr = curr->parentElement()) {
     5844        for (Element* curr = oldActiveElement; curr; curr = curr->parentOrShadowHostElement()) {
    58455845            curr->setActive(false);
    58465846            m_userActionElements.setInActiveChain(curr, false);
Note: See TracChangeset for help on using the changeset viewer.