WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 121776
Add toWebKitCSS*Value functions to cast from CSSValue
https://bugs.webkit.org/show_bug.cgi?id=121776
Summary
Add toWebKitCSS*Value functions to cast from CSSValue
Gyuyoung Kim
Reported
2013-09-22 20:33:56 PDT
CSS_VALUE_TYPE_CASTS can't cover WebKitCSS*Value classes. So, this patch adds toWebKitCSS*Value manually.
Attachments
Patch
(10.78 KB, patch)
2013-09-22 20:36 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch for ews
(10.18 KB, patch)
2013-09-27 01:28 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Gyuyoung Kim
Comment 1
2013-09-22 20:36:42 PDT
Created
attachment 212318
[details]
Patch
Gyuyoung Kim
Comment 2
2013-09-22 21:20:11 PDT
CC'ing Kling. Could you review this patch ?
Darin Adler
Comment 3
2013-09-23 09:58:48 PDT
Comment on
attachment 212318
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=212318&action=review
r=me but we have follow-up work to do on toWebKitCSSShaderValue
> Source/WebCore/css/WebKitCSSShaderValue.h:76 > inline WebKitCSSShaderValue* toWebKitCSSShaderValue(CSSValue* value) > { > + ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSShaderValue()); > return value->isWebKitCSSShaderValue() ? static_cast<WebKitCSSShaderValue*>(value) : 0; > }
This is not right. The existing version of this function is doing a type check and returning nullptr. That does not fit the pattern. We should visit the call sites and add isWebKitCSSShaderValue checks as needed, and then remove that feature. We don’t want to leave things so that one of these toXXX functions does type checking, and lots of others do not.
Darin Adler
Comment 4
2013-09-23 09:59:24 PDT
Comment on
attachment 212318
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=212318&action=review
> Source/WebCore/ChangeLog:8 > + CSS_VALUE_TYPE_CASTS can't cover WebKitCSS*Value classes. So, this patch adds toWebKitCSS*Value manually.
Can’t we make a second macro for these ones with WebKit prefixes instead of writing them all by hand?
Gyuyoung Kim
Comment 5
2013-09-23 16:54:16 PDT
(In reply to
comment #3
)
> (From update of
attachment 212318
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=212318&action=review
> > r=me but we have follow-up work to do on toWebKitCSSShaderValue > > > Source/WebCore/css/WebKitCSSShaderValue.h:76 > > inline WebKitCSSShaderValue* toWebKitCSSShaderValue(CSSValue* value) > > { > > + ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSShaderValue()); > > return value->isWebKitCSSShaderValue() ? static_cast<WebKitCSSShaderValue*>(value) : 0; > > } > > This is not right. The existing version of this function is doing a type check and returning nullptr. That does not fit the pattern. We should visit the call sites and add isWebKitCSSShaderValue checks as needed, and then remove that feature. We don’t want to leave things so that one of these toXXX functions does type checking, and lots of others do not.
Ok, I will prepare a patch regarding your concern.
Gyuyoung Kim
Comment 6
2013-09-23 16:57:47 PDT
(In reply to
comment #4
)
> (From update of
attachment 212318
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=212318&action=review
> > > Source/WebCore/ChangeLog:8 > > + CSS_VALUE_TYPE_CASTS can't cover WebKitCSS*Value classes. So, this patch adds toWebKitCSS*Value manually. > > Can’t we make a second macro for these ones with WebKit prefixes instead of writing them all by hand?
In fact, I introduced WEBKIT_CSS_VALUE_TYPE_CASTS on
https://bugs.webkit.org/attachment.cgi?id=211887&action=review
as well. However, two macros may confuse webkit developers. But, if there is no objection to support two macros, I can prepare "WEBKIT_CSS_VALUE_TYPE_CASTS" again.
Gyuyoung Kim
Comment 7
2013-09-24 17:51:41 PDT
(In reply to
comment #5
)
> (In reply to
comment #3
) > > (From update of
attachment 212318
[details]
[details]) > > View in context:
https://bugs.webkit.org/attachment.cgi?id=212318&action=review
> > > > r=me but we have follow-up work to do on toWebKitCSSShaderValue > > > > > Source/WebCore/css/WebKitCSSShaderValue.h:76 > > > inline WebKitCSSShaderValue* toWebKitCSSShaderValue(CSSValue* value) > > > { > > > + ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSShaderValue()); > > > return value->isWebKitCSSShaderValue() ? static_cast<WebKitCSSShaderValue*>(value) : 0; > > > } > > > > This is not right. The existing version of this function is doing a type check and returning nullptr. That does not fit the pattern. We should visit the call sites and add isWebKitCSSShaderValue checks as needed, and then remove that feature. We don’t want to leave things so that one of these toXXX functions does type checking, and lots of others do not. > > Ok, I will prepare a patch regarding your concern.
I file a
Bug 121886
for this issue.
Gyuyoung Kim
Comment 8
2013-09-24 17:53:09 PDT
Comment on
attachment 212318
[details]
Patch I'd like to go to clean-up static_cast<CSS*Value>. So, this patch is landed.
WebKit Commit Bot
Comment 9
2013-09-24 18:16:44 PDT
Comment on
attachment 212318
[details]
Patch Clearing flags on attachment: 212318 Committed
r156379
: <
http://trac.webkit.org/changeset/156379
>
WebKit Commit Bot
Comment 10
2013-09-24 18:16:47 PDT
All reviewed patches have been landed. Closing bug.
WebKit Commit Bot
Comment 11
2013-09-24 22:18:39 PDT
Re-opened since this is blocked by
bug 121894
Alexey Proskuryakov
Comment 12
2013-09-24 22:23:36 PDT
This caused multiple assertion failures: <
http://build.webkit.org/results/Apple%20MountainLion%20Debug%20WK1%20(Tests)/r156381%20(10381)/results.html
>. Something is still wrong with shader values. Rolled out in <
http://trac.webkit.org/changeset/156383
>.
Gyuyoung Kim
Comment 13
2013-09-24 22:34:28 PDT
(In reply to
comment #12
)
> This caused multiple assertion failures: <
http://build.webkit.org/results/Apple%20MountainLion%20Debug%20WK1%20(Tests)/r156381%20(10381)/results.html
>. Something is still wrong with shader values. > > Rolled out in <
http://trac.webkit.org/changeset/156383
>.
Let me check what is wrong.
Gyuyoung Kim
Comment 14
2013-09-27 01:28:52 PDT
Created
attachment 212791
[details]
Patch for ews
Gyuyoung Kim
Comment 15
2013-09-27 05:35:19 PDT
I think
Bug 121886
fixed assertion fails. So, I'd like to try to land this patch again.
WebKit Commit Bot
Comment 16
2013-09-27 07:30:30 PDT
Comment on
attachment 212791
[details]
Patch for ews Clearing flags on attachment: 212791 Committed
r156542
: <
http://trac.webkit.org/changeset/156542
>
WebKit Commit Bot
Comment 17
2013-09-27 07:30:34 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.
Top of Page
Format For Printing
XML
Clone This Bug