RESOLVED FIXED 136774
Generate toCSSStyleSheet using STYLE_SHEET_TYPE_CASTS
https://bugs.webkit.org/show_bug.cgi?id=136774
Summary Generate toCSSStyleSheet using STYLE_SHEET_TYPE_CASTS
Gyuyoung Kim
Reported 2014-09-11 23:33:41 PDT
As a step to use toFoo, this patch introduces STYLE_SHEET_TYPE_CASTS for toCSSStyleSheet(). This will help to detect wrong type cast. Additonally this patch helps to remove argument type of RefPtr.
Attachments
Patch (6.31 KB, patch)
2014-09-11 23:34 PDT, Gyuyoung Kim
no flags
Patch for landing (6.56 KB, patch)
2014-09-14 17:20 PDT, Gyuyoung Kim
no flags
Patch for landing (6.56 KB, patch)
2014-09-14 19:31 PDT, Gyuyoung Kim
no flags
Gyuyoung Kim
Comment 1 2014-09-11 23:34:26 PDT
Gyuyoung Kim
Comment 2 2014-09-13 21:03:07 PDT
CC'ing Darin.
Darin Adler
Comment 3 2014-09-14 12:37:37 PDT
Comment on attachment 238017 [details] Patch 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*.
Gyuyoung Kim
Comment 4 2014-09-14 17:20:11 PDT
Created attachment 238096 [details] Patch for landing
Gyuyoung Kim
Comment 5 2014-09-14 19:31:31 PDT
Created attachment 238101 [details] Patch for landing
WebKit Commit Bot
Comment 6 2014-09-14 21:07:42 PDT
Comment on attachment 238101 [details] Patch for landing Clearing flags on attachment: 238101 Committed r173611: <http://trac.webkit.org/changeset/173611>
WebKit Commit Bot
Comment 7 2014-09-14 21:07:45 PDT
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.