WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
37929
[Mac] Implement LayoutTestController::markerTextForListItem()
https://bugs.webkit.org/show_bug.cgi?id=37929
Summary
[Mac] Implement LayoutTestController::markerTextForListItem()
Jakub Wieczorek
Reported
2010-04-21 09:16:50 PDT
Added in
http://trac.webkit.org/changeset/57986
and used in the following tests: fast/lists/ol-nested-items-dynamic-insert.html fast/lists/ol-nested-items-dynamic-remove.html fast/lists/ol-nested-items.html fast/lists/ol-nested-list-dynamic-insert.html fast/lists/ol-nested-list-dynamic-remove.html fast/lists/ol-nested-list.html
Attachments
Patch
(7.52 KB, patch)
2010-07-14 21:06 PDT
,
Daniel Bates
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Daniel Bates
Comment 1
2010-07-14 21:06:23 PDT
Created
attachment 61603
[details]
Patch I thought to split up the Mac and Windows patches and use
Bug #42054
as a meta bug. With insight from Adam Roben, I updated the patch based on Darin Adler's comment in
Bug #42054
<
https://bugs.webkit.org/show_bug.cgi?id=42054#c4
>. Also, added class function +[DOMElement _DOMElementFromJSContext] to convert a JSContextRef and JSValueRef into a DOMElement.
WebKit Review Bot
Comment 2
2010-07-14 21:07:26 PDT
Attachment 61603
[details]
did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebKit/mac/DOM/WebDOMOperationsPrivate.h:32: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 3
2010-07-15 06:27:19 PDT
Comment on
attachment 61603
[details]
Patch
> +@implementation DOMElement (WebDOMElementOperationsPrivate)
I suggest a blank line after "@implementation" here.
> + if (!context) > + return 0; > + > + JSLock lock(SilenceAssertionsOnly); > + ExecState* execState = toJS(context); > + if (!value) > + return 0;
No reason to wait until after taking JSLock to null-check value.
> + > + JSValue jsValue = toJS(execState, value); > + Element* element = toElement(jsValue); > + return element ? (DOMElement *)kit(element) : 0; > +}
The kit function can handle null. You should be able to write it like this: return kit(toElement(toJS(toJS(context), value))); Without all the local variables and the type casts.
> + > +- (NSString *)_markerTextForListItem > +{ > + return WebCore::markerTextForListItem(static_cast<WebCore::Element*>(core(self)));
Do you need the type cast? I thought core and kit had type-specific versions.
> +@end
I suggest a line before "@end".
> + JSRetainPtr<JSStringRef> markerText(Adopt, JSStringCreateWithCFString((CFStringRef)[element _markerTextForListItem])); > + return markerText;
Will this work for elements that return nil for the string?
Daniel Bates
Comment 4
2010-07-15 12:13:58 PDT
Thank you for the review. (In reply to
comment #3
)
> (From update of
attachment 61603
[details]
) > > +@implementation DOMElement (WebDOMElementOperationsPrivate) > > I suggest a blank line after "@implementation" here.
Will add blank line before I land.
> > > + if (!context) > > + return 0; > > + > > + JSLock lock(SilenceAssertionsOnly); > > + ExecState* execState = toJS(context); > > + if (!value) > > + return 0; > > No reason to wait until after taking JSLock to null-check value.
Will change before I land.
> > > + > > + JSValue jsValue = toJS(execState, value); > > + Element* element = toElement(jsValue); > > + return element ? (DOMElement *)kit(element) : 0; > > +} > > The kit function can handle null. You should be able to write it like this: > > return kit(toElement(toJS(toJS(context), value))); > > Without all the local variables and the type casts.
Will change before I land.
> > > + > > +- (NSString *)_markerTextForListItem > > +{ > > + return WebCore::markerTextForListItem(static_cast<WebCore::Element*>(core(self))); > > Do you need the type cast? I thought core and kit had type-specific versions.
The cast is not necessary, will import DOMElementInternal.h to use the type-specific kit() (some how missed this file when scanning through the source).
> > > +@end > > I suggest a line before "@end".
Will add blank line.
> > > + JSRetainPtr<JSStringRef> markerText(Adopt, JSStringCreateWithCFString((CFStringRef)[element _markerTextForListItem])); > > + return markerText; > > Will this work for elements that return nil for the string?
-[DOMElement _markerTextForListItem] never returns the nil object. Moreover, it does work correctly should WebCore::markerTextForListItem() return a null string (i.e. WebCore::String()).
Daniel Bates
Comment 5
2010-07-15 12:18:52 PDT
Committed
r63445
: <
http://trac.webkit.org/changeset/63445
>
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