Changeset 126201 in webkit


Ignore:
Timestamp:
Aug 21, 2012 3:51:54 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Track -webkit property usage.
https://bugs.webkit.org/show_bug.cgi?id=93420

Patch by Tab Atkins <tabatkins@google.com> on 2012-08-21
Reviewed by Ojan Vafai.

First draft of an attempt to track all usage of -webkit prefixed properties across the web.
This attempt is dumb, but should provide useful data as a first-pass.
I plan to optimize this for better data collection in the future.

No tests added, as this is untestable currently.
It should have zero effect besides histogramming.

  • css/CSSParser.cpp:

(WebCore::cssPropertyID):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r126199 r126201  
     12012-08-21  Tab Atkins  <tabatkins@google.com>
     2
     3        Track -webkit property usage.
     4        https://bugs.webkit.org/show_bug.cgi?id=93420
     5
     6        Reviewed by Ojan Vafai.
     7
     8        First draft of an attempt to track all usage of -webkit prefixed properties across the web.
     9        This attempt is dumb, but should provide useful data as a first-pass.
     10        I plan to optimize this for better data collection in the future.
     11
     12        No tests added, as this is untestable currently.
     13        It should have zero effect besides histogramming.
     14
     15        * css/CSSParser.cpp:
     16        (WebCore::cssPropertyID):
     17
    1182012-08-21  Alec Flett  <alecflett@chromium.org>
    219
  • trunk/Source/WebCore/css/CSSParser.cpp

    r126192 r126201  
    6363#include "HTMLParserIdioms.h"
    6464#include "HashTools.h"
     65#include "HistogramSupport.h"
    6566#include "MediaList.h"
    6667#include "MediaQueryExp.h"
     
    1012510126
    1012610127    const Property* hashTableEntry = findProperty(name, length);
    10127     return hashTableEntry ? static_cast<CSSPropertyID>(hashTableEntry->id) : CSSPropertyInvalid;
     10128    const CSSPropertyID propertyID = hashTableEntry ? static_cast<CSSPropertyID>(hashTableEntry->id) : CSSPropertyInvalid;
     10129
     10130    // 600 is comfortably larger than numCSSProperties to allow for growth
     10131    static const int CSSPropertyHistogramSize = 600;
     10132    COMPILE_ASSERT(CSSPropertyHistogramSize > numCSSProperties, number_of_css_properties_exceed_CSSPropertyHistogramSize);
     10133
     10134    if (hasPrefix(buffer, length, "-webkit-") && propertyID != CSSPropertyInvalid)
     10135        HistogramSupport::histogramEnumeration("CSS.PrefixUsage", max(1, propertyID - firstCSSProperty), CSSPropertyHistogramSize);
     10136
     10137    return propertyID;
    1012810138}
    1012910139
Note: See TracChangeset for help on using the changeset viewer.