Changeset 214790 in webkit


Ignore:
Timestamp:
Apr 3, 2017 6:33:41 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r214305 - NeverDestroyed<MediaQueryEvaluator> must explicitly construct with a String
https://bugs.webkit.org/show_bug.cgi?id=169987
<rdar://problem/31211087>

Reviewed by Alex Christensen.

CSSDefaultStyleSheets creates a static MediaQueryEvaluator, but thanks
to the template magic of NeverDestroyed, it was converting the char*
argument into a bool, and calling the wrong constructor.

Unfortunately this is difficult to test because it only affects
the default UA style sheets, and they currently don't have
and @media rules (which would always evaluate to true given
the bug). I don't want to put in a useless rule just to check
if the bug is fixed. When one is added for bug 168447, this change
will be exercised.

  • css/CSSDefaultStyleSheets.cpp: Explicitly construct with a String

rather than a char*.
(WebCore::screenEval):
(WebCore::printEval):

Location:
releases/WebKitGTK/webkit-2.16/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog

    r214788 r214790  
     12017-03-22  Dean Jackson  <dino@apple.com>
     2
     3        NeverDestroyed<MediaQueryEvaluator> must explicitly construct with a String
     4        https://bugs.webkit.org/show_bug.cgi?id=169987
     5        <rdar://problem/31211087>
     6
     7        Reviewed by Alex Christensen.
     8
     9        CSSDefaultStyleSheets creates a static MediaQueryEvaluator, but thanks
     10        to the template magic of NeverDestroyed, it was converting the char*
     11        argument into a bool, and calling the wrong constructor.
     12
     13        Unfortunately this is difficult to test because it only affects
     14        the default UA style sheets, and they currently don't have
     15        and @media rules (which would always evaluate to true given
     16        the bug). I don't want to put in a useless rule just to check
     17        if the bug is fixed. When one is added for bug 168447, this change
     18        will be exercised.
     19
     20        * css/CSSDefaultStyleSheets.cpp: Explicitly construct with a String
     21        rather than a char*.
     22        (WebCore::screenEval):
     23        (WebCore::printEval):
     24
    1252017-03-22  Antti Koivisto  <antti@apple.com>
    226
  • releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSDefaultStyleSheets.cpp

    r210959 r214790  
    8585static const MediaQueryEvaluator& screenEval()
    8686{
    87     static NeverDestroyed<const MediaQueryEvaluator> staticScreenEval("screen");
     87    static NeverDestroyed<const MediaQueryEvaluator> staticScreenEval(String(ASCIILiteral("screen")));
    8888    return staticScreenEval;
    8989}
     
    9191static const MediaQueryEvaluator& printEval()
    9292{
    93     static NeverDestroyed<const MediaQueryEvaluator> staticPrintEval("print");
     93    static NeverDestroyed<const MediaQueryEvaluator> staticPrintEval(String(ASCIILiteral("print")));
    9494    return staticPrintEval;
    9595}
Note: See TracChangeset for help on using the changeset viewer.