Bug 137429

Summary: Use is<>() / downcast<>() for StyleSheet subclasses
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CSSAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, darin, kling, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 137056    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2014-10-04 21:51:38 PDT
Use is<>() / downcast<>() for StyleSheet subclasses
Comment 1 Chris Dumez 2014-10-04 22:14:02 PDT
Created attachment 239291 [details]
Patch
Comment 2 Benjamin Poulain 2014-10-05 15:54:40 PDT
Comment on attachment 239291 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=239291&action=review

> Source/WebCore/dom/DocumentStyleSheetCollection.cpp:411
>      for (unsigned i = 0; i < sheets.size(); ++i) {

Let's update the loop too.

> Source/WebCore/dom/DocumentStyleSheetCollection.cpp:413
> +        if (!is<CSSStyleSheet>(*sheets[i]))
>              continue;

I would move this after sheets[i]->disabled() to reduce the span between is<> and downcast<>, making it easier to follow the flow.
Comment 3 Chris Dumez 2014-10-05 16:37:58 PDT
Created attachment 239302 [details]
Patch
Comment 4 WebKit Commit Bot 2014-10-05 17:24:00 PDT
Comment on attachment 239302 [details]
Patch

Clearing flags on attachment: 239302

Committed r174332: <http://trac.webkit.org/changeset/174332>
Comment 5 WebKit Commit Bot 2014-10-05 17:24:04 PDT
All reviewed patches have been landed.  Closing bug.