Changeset 132269 in webkit


Ignore:
Timestamp:
Oct 23, 2012 2:40:44 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Generated should not be supported for things with a shadow
https://bugs.webkit.org/show_bug.cgi?id=98836

Patch by Elliott Sprehn <esprehn@chromium.org> on 2012-10-23
Reviewed by Dimitri Glazkov.

Source/WebCore:

As far as CSS is concerned inputs and things with shadow content inside
shouldn't support pseudo elements like :before, :after or :first-letter.
Neither Gecko or Presto supports it, and we only accidentally supported
it.

Until the spec tells us what to do we should disable support. This is
also neccesary because the new generated content implementation doesn't
support shadows.

Test: fast/forms/pseudo-elements.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::updateFirstLetter):

  • rendering/RenderListBox.h: Added missing canHaveGeneratedChildren() that returns false.
  • rendering/RenderObjectChildList.cpp:

(WebCore::RenderObjectChildList::updateBeforeAfterContent):

LayoutTests:

Change all pseudos on <input> tests to be ref tests and clean up the tests.
They now make sure we don't support generated content on things with a shadow.
Also added another test for the other form control types to ensure they don't
support pseudos either.

  • fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.html: Added.
  • fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
  • fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements.html:
  • fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.html: Added.
  • fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
  • fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements.html:
  • fast/forms/pseudo-elements-expected.html: Added.
  • fast/forms/pseudo-elements.html: Added.
  • fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.html: Added.
  • fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
  • fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements.html:
  • fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.html: Added.
  • fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
  • fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements.html:
  • platform/chromium-linux/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-linux/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-linux/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-mac-snowleopard/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-mac-snowleopard/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-mac-snowleopard/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-mac-snowleopard/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-mac/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-mac/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-mac/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-mac/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-win/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-win/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-win/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
  • platform/chromium-win/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
Location:
trunk
Files:
6 added
20 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r132268 r132269  
     12012-10-23  Elliott Sprehn  <esprehn@chromium.org>
     2
     3        Generated should not be supported for things with a shadow
     4        https://bugs.webkit.org/show_bug.cgi?id=98836
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Change all pseudos on <input> tests to be ref tests and clean up the tests.
     9        They now make sure we don't support generated content on things with a shadow.
     10        Also added another test for the other form control types to ensure they don't
     11        support pseudos either.
     12
     13        * fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.html: Added.
     14        * fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
     15        * fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements.html:
     16        * fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.html: Added.
     17        * fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
     18        * fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements.html:
     19        * fast/forms/pseudo-elements-expected.html: Added.
     20        * fast/forms/pseudo-elements.html: Added.
     21        * fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.html: Added.
     22        * fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
     23        * fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements.html:
     24        * fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.html: Added.
     25        * fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
     26        * fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements.html:
     27        * platform/chromium-linux/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     28        * platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     29        * platform/chromium-linux/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     30        * platform/chromium-linux/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     31        * platform/chromium-mac-snowleopard/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     32        * platform/chromium-mac-snowleopard/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     33        * platform/chromium-mac-snowleopard/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     34        * platform/chromium-mac-snowleopard/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     35        * platform/chromium-mac/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     36        * platform/chromium-mac/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     37        * platform/chromium-mac/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     38        * platform/chromium-mac/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     39        * platform/chromium-win/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     40        * platform/chromium-win/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     41        * platform/chromium-win/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     42        * platform/chromium-win/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
     43
    1442012-10-23  Huang Dongsung  <luxtella@company100.net>
    245
  • trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements.html

    r130480 r132269  
    1 <html>
    2 <head>
    3 <style type="text/css">
     1<!DOCTYPE html>
     2
     3<style>
    44.after:after { content: "[after]"; }
    55.before:before { content: "[before]"; }
    66.first-letter:first-letter { color: green; font-size: 200%; }
    77</style>
    8 </head>
    9 <body>
    10 <ul>
    11     <li><input type="date" value="1234-05-07" class="after"></li>
    12     <li><input type="date" value="1234-05-07" class="before"></li>
    13     <li><input type="date" value="1234-05-07" class="first-letter"></li>
    14 </ul>
    15 <script>
    16 if (window.testRunner)
    17     testRunner.dumpAsText(true);
    18 </script>
    19 </body>
    20 </html>
     8
     9<input type="date" value="1234-05-07" class="after"><br>
     10<input type="date" value="1234-05-07" class="before"><br>
     11<input type="date" value="1234-05-07" class="first-letter">
  • trunk/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements.html

    r130010 r132269  
    1 <html>
    2 <head>
    3 <style type="text/css">
     1<!DOCTYPE html>
     2
     3<style>
    44.after:after { content: "[after]"; }
    55.before:before { content: "[before]"; }
    66.first-letter:first-letter { color: green; font-size: 200%; }
    77</style>
    8 </head>
    9 <body>
    10 <ul>
    11     <li><input type="month" value="1982-11" class="after"></li>
    12     <li><input type="month" value="1982-11" class="before"></li>
    13     <li><input type="month" value="1982-11" class="first-letter"></li>
    14 </ul>
    15 </body>
    16 <script>
    17 if (window.testRunner)
    18     testRunner.dumpAsText(true);
    19 </script>
    20 </html>
     8
     9<input type="month" value="1982-11" class="after"><br>
     10<input type="month" value="1982-11" class="before"><br>
     11<input type="month" value="1982-11" class="first-letter">
  • trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements.html

    r127396 r132269  
    1 <html>
    2 <head>
    3 <style type="text/css">
     1<!DOCTYPE html>
     2
     3<style>
    44.after:after { content: "[after]"; }
    55.before:before { content: "[before]"; }
    66.first-letter:first-letter { color: green; font-size: 200%; }
    77</style>
    8 </head>
    9 <body>
    10 <ul>
    11     <li><input type="time" value="12:34" class="after"></li>
    12     <li><input type="time" value="12:34" class="before"></li>
    13     <li><input type="time" value="12:34" class="first-letter"></li>
    14 </ul>
    15 </body>
    16 <script>
    17 if (window.testRunner) {
    18     testRunner.dumpAsText(true);
    19 }
    20 </script>
    21 </html>
     8
     9<input type="time" value="12:34" class="after"><br>
     10<input type="time" value="12:34" class="before"><br>
     11<input type="time" value="12:34" class="first-letter">
  • trunk/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements.html

    r130107 r132269  
    1 <html>
    2 <head>
    3 <style type="text/css">
     1<!DOCTYPE html>
     2
     3<style>
    44.after:after { content: "[after]"; }
    55.before:before { content: "[before]"; }
    66.first-letter:first-letter { color: green; font-size: 200%; }
    77</style>
    8 </head>
    9 <body>
    10 <ul>
    11     <li><input type="week" value="1982-W25" class="after"></li>
    12     <li><input type="week" value="1982-W25" class="before"></li>
    13     <li><input type="week" value="1982-W25" class="first-letter"></li>
    14 </ul>
    15 </body>
    16 <script>
    17 if (window.testRunner)
    18     testRunner.dumpAsText(true);
    19 </script>
    20 </html>
     8
     9<input type="week" value="1982-W25" class="after"><br>
     10<input type="week" value="1982-W25" class="before"><br>
     11<input type="week" value="1982-W25" class="first-letter">
  • trunk/Source/WebCore/ChangeLog

    r132268 r132269  
     12012-10-23  Elliott Sprehn  <esprehn@chromium.org>
     2
     3        Generated should not be supported for things with a shadow
     4        https://bugs.webkit.org/show_bug.cgi?id=98836
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        As far as CSS is concerned inputs and things with shadow content inside
     9        shouldn't support pseudo elements like :before, :after or :first-letter.
     10        Neither Gecko or Presto supports it, and we only accidentally supported
     11        it.
     12
     13        Until the spec tells us what to do we should disable support. This is
     14        also neccesary because the new generated content implementation doesn't
     15        support shadows.
     16
     17        Test: fast/forms/pseudo-elements.html
     18
     19        * rendering/RenderBlock.cpp:
     20        (WebCore::RenderBlock::updateFirstLetter):
     21        * rendering/RenderListBox.h: Added missing canHaveGeneratedChildren() that returns false.
     22        * rendering/RenderObjectChildList.cpp:
     23        (WebCore::RenderObjectChildList::updateBeforeAfterContent):
     24
    1252012-10-23  Huang Dongsung  <luxtella@company100.net>
    226
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r132164 r132269  
    65186518        return;
    65196519
     6520    // Disallow generated content in shadows until the spec says what to do. See: http://webkit.org/b/98836
     6521    if (isShadowHost(firstLetterBlock->node()))
     6522        return;
     6523
    65206524    // If the child already has style, then it has already been created, so we just want
    65216525    // to update it.
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r132112 r132269  
    6868    virtual bool canBeReplacedWithInlineRunIn() const OVERRIDE;
    6969    virtual bool hasControlClip() const { return true; }
     70    virtual bool canHaveGeneratedChildren() const OVERRIDE { return false; }
    7071    virtual void paintObject(PaintInfo&, const LayoutPoint&);
    7172    virtual LayoutRect controlClipRect(const LayoutPoint&) const;
  • trunk/Source/WebCore/rendering/RenderObjectChildList.cpp

    r131666 r132269  
    3030#include "AXObjectCache.h"
    3131#include "ContentData.h"
     32#include "Element.h"
    3233#include "RenderBlock.h"
    3334#include "RenderCounter.h"
     
    341342        styledObject = owner;
    342343
     344    // Disallow generated content in shadows until the spec says what to do. See: http://webkit.org/b/98836
     345    if (isShadowHost(styledObject->node()))
     346        return;
     347
    343348    RenderStyle* pseudoElementStyle = styledObject->getCachedPseudoStyle(type);
    344349    RenderObject* child;
Note: See TracChangeset for help on using the changeset viewer.