Note: There are a few cases of duplicates in user autocompletion which are being worked on.

CGCreateInterfaceObjectsMethod should probably use CGThings for the CreateInterfaceObjects calls.

RESOLVED FIXED in mozilla15

Status

()

Core
DOM
P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

(Blocks: 1 bug)

Trunk
mozilla15
x86
Mac OS X
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Instead of manually munging whitespace.
(Assignee)

Comment 1

5 years ago
Created attachment 613362 [details] [diff] [review]
Like so
Assignee: nobody → bzbarsky
Attachment #613362 - Flags: review?(peterv)
(Assignee)

Updated

5 years ago
Whiteboard: [need review]
(Assignee)

Updated

5 years ago
Priority: -- → P2
Comment on attachment 613362 [details] [diff] [review]
Like so

Review of attachment 613362 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bindings/Codegen.py
@@ +824,2 @@
>              if len(idsToInit) > 1:
> +                initIds = CGWrapper(initIds, pre="(", post=")", reindent=True)

I wonder if it'd make sense to add support for this to CGList (pre and post for len > 1).

@@ +863,5 @@
> +        ourList = CGList([CGGeneric(getParentProto)], "\n\n")
> +        if initIds is not None:
> +            ourList.prepend(initIds)
> +        if chrome is not None:
> +            ourList.append(chrome)

Would it make sense to make CGList skip None values?
Attachment #613362 - Flags: review?(peterv) → review+
(Assignee)

Comment 3

5 years ago
> I wonder if it'd make sense to add support for this to CGList (pre and post for len > 1).

We'd need to add the reindent thing there too...  We could do that, I guess.  Want me to?

> Would it make sense to make CGList skip None values?

Yes, absolutely.  I'll do that instead.
(Assignee)

Comment 4

5 years ago
Created attachment 613644 [details] [diff] [review]
With that change
Attachment #613362 - Attachment is obsolete: true
Attachment #613644 - Flags: review?(peterv)
(Assignee)

Updated

5 years ago
Blocks: 742217
Comment on attachment 613644 [details] [diff] [review]
With that change

Review of attachment 613644 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bindings/Codegen.py
@@ +251,4 @@
>      def declare(self):
> +        decl = self.child.declare()
> +        if self.reindent:
> +            decl = decl.replace("\n", "\n" + (" " * len(self.declarePre)))

Should these .rstrip(" ") to avoid trailing whitespace?
Attachment #613644 - Flags: review?(peterv) → review+
(Assignee)

Comment 6

5 years ago
Hmm.  Long-term, we should never have trailing whitespace in cgitems, imo.

But you raise another interesting question.  We don't really want to add whitespace to blank lines.  So perhaps this should do something more like what CGIndenter does, in terms of the regexp?
(Assignee)

Comment 7

5 years ago
> Long-term, we should never have trailing whitespace in cgitems, imo.

That includes trailing newlines, which are the case rstrip() would help with.
(Assignee)

Comment 8

5 years ago
Per discussion with peter, I'll just smack this with stripTrailingWhitespace().
(Assignee)

Comment 9

5 years ago
https://hg.mozilla.org/projects/birch/rev/5ccd428446a9
Flags: in-testsuite-
Whiteboard: [need review] → [need birch merge]
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/5ccd428446a9
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: [need birch merge]
You need to log in before you can comment on or make changes to this bug.