Closed
Bug 224164
Opened 21 years ago
Closed 21 years ago
inCSSValueSearch shouldn't use internal APIs
Categories
(Other Applications :: DOM Inspector, defect)
Other Applications
DOM Inspector
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
(Whiteboard: [patch])
Attachments
(1 file, 1 obsolete file)
10.75 KB,
patch
|
caillon
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
inCSSValueSearch shouldn't use internal APIs. This causes pain such as the
bustage from bug 167262's codesize reduction checkin and the existence of
nsICSSStyleRule::GetValue and the things it calls. I have a preliminary patch
(untested), but it needs some work in inCSSValueSearch::SearchStyleValue.
Assignee | ||
Comment 1•21 years ago
|
||
Attachment #134464 -
Flags: review?(caillon)
Assignee | ||
Updated•21 years ago
|
Attachment #134464 -
Flags: review?(caillon)
Assignee | ||
Comment 2•21 years ago
|
||
caillon, how do I test this code? The only caller seems to be
http://lxr.mozilla.org/seamonkey/source/extensions/inspector/resources/content/search/modules/junkImgs/junkImgs.xml
Assignee | ||
Comment 3•21 years ago
|
||
This should be equivalent to the old code.
Attachment #134464 -
Attachment is obsolete: true
Comment 4•21 years ago
|
||
> caillon, how do I test this code?
You probably don't. This looks like another of hewitt's unfinished pieces...
Assignee | ||
Comment 5•21 years ago
|
||
Comment on attachment 137807 [details] [diff] [review]
patch
In that case, I think I'd like to just get it reviewed, then, since I'd rather
not have to go through more pain because this code is depending on unstable
APIs...
Attachment #137807 -
Flags: review?(caillon)
Comment 6•21 years ago
|
||
Comment on attachment 137807 [details] [diff] [review]
patch
>- if (value.GetUnit() == eCSSUnit_URL) {
>+ if (StringBeginsWith(aValue, NS_LITERAL_STRING("url(")) &&
>+ StringEndsWith(aValue, NS_LITERAL_STRING(")"))) {
I tried thinking of a way to use nsIDOMCSSPrimitiveValue::CSS_URL, but there
really isn't one without knowledge of the css parser (in more places). Oh,
well.
r=caillon
Attachment #137807 -
Flags: review?(caillon) → review+
Assignee | ||
Updated•21 years ago
|
Attachment #137807 -
Flags: superreview?(bz-vacation)
Assignee | ||
Updated•21 years ago
|
Whiteboard: [patch]
![]() |
||
Comment 7•21 years ago
|
||
Comment on attachment 137807 [details] [diff] [review]
patch
>Index: inCSSValueSearch.cpp
>+inCSSValueSearch::SearchStyleSheet(nsIDOMCSSStyleSheet* aStyleSheet, nsIURI* aBaseURL)
>+ if (aStyleSheet) {
Just return early if that's null, maybe?
>+ NS_NewURI(getter_AddRefs(baseURL), NS_ConvertUTF16toUTF8(href),
>+ nsnull, aBaseURL);
drop the NS_ConvertUTF16toUTF8 -- nsNetUtil has a NS_NewURI that takes an
nsAString. It'll compile to the same code if it gets inlined like it's
supposed to, but will be more readable...
>+inCSSValueSearch::SearchStyleRule(nsIDOMCSSStyleRule* aStyleRule, nsIURI*
>+ decl->GetPropertyValue(property, value);
This could use an XXX comment saying that GetPropertyCSSValue is what we really
want here... once we implement it.
sr=bzbarsky with that.
Attachment #137807 -
Flags: superreview?(bz-vacation) → superreview+
Assignee | ||
Comment 8•21 years ago
|
||
Fix checked in to trunk, 2003-12-29 11:05 -0800.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: Core → Other Applications
Updated•18 years ago
|
QA Contact: timeless → dom-inspector
You need to log in
before you can comment on or make changes to this bug.
Description
•