[webkit-reviews] review granted: [Bug 136774] Generate toCSSStyleSheet using STYLE_SHEET_TYPE_CASTS : [Attachment 238017] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Sep 14 12:37:33 PDT 2014
Darin Adler <darin at apple.com> has granted Gyuyoung Kim
<gyuyoung.kim at webkit.org>'s request for review:
Bug 136774: Generate toCSSStyleSheet using STYLE_SHEET_TYPE_CASTS
https://bugs.webkit.org/show_bug.cgi?id=136774
Attachment 238017: Patch
https://bugs.webkit.org/attachment.cgi?id=238017&action=review
------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=238017&action=review
> Source/WebCore/dom/ProcessingInstruction.cpp:225
> -
static_cast<CSSStyleSheet*>(m_sheet.get())->contents().parseString(sheet);
> + toCSSStyleSheet(m_sheet)->contents().parseString(sheet);
Since we are assuming m_sheet is non-null, it would be better style to write:
toCSSStyleSheet(*m_sheet)->contents()
This ensures we don't compile in bogus null checks, although it’s possible the
compiler is smart enough to not compile them anyway.
> Source/WebCore/dom/ProcessingInstruction.cpp:238
> -
static_cast<CSSStyleSheet*>(m_sheet.get())->contents().checkLoaded();
> + toCSSStyleSheet(m_sheet)->contents().checkLoaded();
Ditto.
> Source/WebCore/inspector/InspectorCSSAgent.cpp:686
> StyleSheet* styleSheet = list->item(i);
Should be StyleSheet& instead of StyleSheet*.
More information about the webkit-reviews
mailing list