RESOLVED FIXED 107770
Add form-related instrumentations, and support 33+ features in FeatureObserver
https://bugs.webkit.org/show_bug.cgi?id=107770
Summary Add form-related instrumentations, and support 33+ features in FeatureObserver
Kent Tamura
Reported 2013-01-23 18:00:36 PST
Add form-related instrumentations, and support 33+ features in FeatureObserver
Attachments
Patch (24.72 KB, patch)
2013-01-23 18:07 PST, Kent Tamura
no flags
Patch 2 (24.64 KB, patch)
2013-01-23 18:36 PST, Kent Tamura
no flags
Patch 3 (24.89 KB, patch)
2013-01-23 21:12 PST, Kent Tamura
no flags
Patch for landign (24.97 KB, patch)
2013-01-23 21:39 PST, Kent Tamura
no flags
Kent Tamura
Comment 1 2013-01-23 18:07:03 PST
Kentaro Hara
Comment 2 2013-01-23 18:15:52 PST
Comment on attachment 184371 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184371&action=review > Source/WebCore/html/TelephoneInputType.cpp:43 > + FeatureObserver::observe(element->document()->domWindow(), FeatureObserver::InputTypeTel); InputTypeTel => InputTypeTelephone ? > Source/WebCore/page/FeatureObserver.cpp:48 > + if (!m_hasNonZeroFeatureBits) 'if (!m_featureBits.size())' is slower than '!m_hasNonZeroFeatureBits' ? If you need to use m_hasNonZeroFeatureBits for performance, let's rename it to m_hasFeatureBits (and flip true/false). > Source/WebCore/page/FeatureObserver.h:94 > + AutoFocusAttribute, > + AutoSaveAttribute, > + FormAttribute, > + IncrementalAttribute, > + ListAttribute, > + MinAttribute, > + MaxAttribute, > + PatternAttribute, > + PlaceholderAttribute, > + PrecisionAttribute, > + PrefixedDirectoryAttribute, > + PrefixedSpeechAttribute, > + RequiredAttribute, > + ResultsAttribute, > + StepAttribute, > + DataListElement, > + InputTypeColor, > + InputTypeDate, > + InputTypeDateTime, > + InputTypeDateTimeFallback, > + InputTypeDateTimeLocal, > + InputTypeEmail, > + InputTypeMonth, > + InputTypeNumber, > + InputTypeRange, > + InputTypeSearch, > + InputTypeTel, > + InputTypeTime, > + InputTypeURL, > + InputTypeWeek, > + InputTypeWeekFallback, Shall we sort them in the alphabetical order?
Kentaro Hara
Comment 3 2013-01-23 18:17:22 PST
(In reply to comment #2) > 'if (!m_featureBits.size())' is slower than '!m_hasNonZeroFeatureBits' ? > > If you need to use m_hasNonZeroFeatureBits for performance, let's rename it to m_hasFeatureBits (and flip true/false). Ignore this part: "(and flip true/false)".
Kent Tamura
Comment 4 2013-01-23 18:20:15 PST
Comment on attachment 184371 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184371&action=review >> Source/WebCore/html/TelephoneInputType.cpp:43 >> + FeatureObserver::observe(element->document()->domWindow(), FeatureObserver::InputTypeTel); > > InputTypeTel => InputTypeTelephone ? I think either is ok. The class name is "TelephoneInputTyp", but it represents <input type=tel>. >> Source/WebCore/page/FeatureObserver.cpp:48 >> + if (!m_hasNonZeroFeatureBits) > > 'if (!m_featureBits.size())' is slower than '!m_hasNonZeroFeatureBits' ? > > If you need to use m_hasNonZeroFeatureBits for performance, let's rename it to m_hasFeatureBits (and flip true/false). m_featureBits has a fixed size. m_featureBits.size() is always true. >> Source/WebCore/page/FeatureObserver.h:94 >> + InputTypeWeekFallback, > > Shall we sort them in the alphabetical order? will do.
Kentaro Hara
Comment 5 2013-01-23 18:26:19 PST
(In reply to comment #4) > > If you need to use m_hasNonZeroFeatureBits for performance, let's rename it to m_hasFeatureBits (and flip true/false). > > m_featureBits has a fixed size. m_featureBits.size() is always true. At first I thought it would be better to implement BitVector::isEmpty(), but it might be tricky to implement it without adding one extra bool to BitVector. So adding one bool to FeatureObserver makes sense to me.
Kent Tamura
Comment 6 2013-01-23 18:36:36 PST
Kentaro Hara
Comment 7 2013-01-23 18:42:18 PST
Comment on attachment 184375 [details] Patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=184375&action=review > Source/WebCore/page/FeatureObserver.h:68 > + AutoFocusAttribute, > + AutoSaveAttribute, > + DataListElement, Maybe we want to sort all items in the Feature enum? (If you want to keep all form-related features nearby each other, you can prefix them with "Form".) > Source/WebCore/page/FeatureObserver.h:115 > + OwnPtr<BitVector> m_featureBits; Even better!
Kent Tamura
Comment 8 2013-01-23 19:09:31 PST
Comment on attachment 184375 [details] Patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=184375&action=review >> Source/WebCore/page/FeatureObserver.h:68 >> + DataListElement, > > Maybe we want to sort all items in the Feature enum? (If you want to keep all form-related features nearby each other, you can prefix them with "Form".) No. We shouldn't change integer values for existing features because the integer values are already being recorded.
Kentaro Hara
Comment 9 2013-01-23 19:27:35 PST
Comment on attachment 184375 [details] Patch 2 Makes sense to me
Kent Tamura
Comment 10 2013-01-23 20:36:24 PST
Comment on attachment 184375 [details] Patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=184375&action=review > Source/WebCore/html/ColorInputType.cpp:75 > + FeatureObserver::observe(element->document()->domWindow(), FeatureObserver::InputTypeColor); element->document()->domWindow() is inefficient because FeatureObserver::observe obtains the Document from the DOMWindow.
Kent Tamura
Comment 11 2013-01-23 21:12:45 PST
Created attachment 184394 [details] Patch 3 Add Document* version of observe()
Kentaro Hara
Comment 12 2013-01-23 21:21:10 PST
Comment on attachment 184394 [details] Patch 3 View in context: https://bugs.webkit.org/attachment.cgi?id=184394&action=review > Source/WebCore/page/FeatureObserver.h:98 > // Add new features above this line. Also it might be better to mention that a new feature must be added at the last line so that we won't break already recorded results.
Kent Tamura
Comment 13 2013-01-23 21:39:50 PST
Created attachment 184398 [details] Patch for landign Add a comment
WebKit Review Bot
Comment 14 2013-01-23 22:09:33 PST
Comment on attachment 184398 [details] Patch for landign Clearing flags on attachment: 184398 Committed r140655: <http://trac.webkit.org/changeset/140655>
WebKit Review Bot
Comment 15 2013-01-23 22:09:38 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.