Closed Bug 1173909 Opened 9 years ago Closed 9 years ago

ui-showcase injects CSS from both standalone and desktop into each iframe

Categories

(Hello (Loop) :: Client, defect)

defect
Not set
normal
Points:
2

Tracking

(firefox41 fixed)

RESOLVED FIXED
mozilla41
Iteration:
41.3 - Jun 29
Tracking Status
firefox41 --- fixed

People

(Reporter: dmosedale, Assigned: dmosedale)

References

Details

(Whiteboard: [faster])

User Story

As a developer, I should be able to count on the views being displayed in the ui-showcase being extremely close to (if not exactly) the same as the views displayed in the real client.  I should not have to worry about styles being applied from both standalone and desktop clients to create frankenviews.

Attachments

(1 file, 5 obsolete files)

Right now, the ui-showcase injects the head from the containing document (which includes the stylesheets from both the desktop and standalone clients).  As a result, sometimes the rules conflict and make the showcase display something as it never gets displayed in reality.

We should be able to set up two different lists of CSS headers.  One of these list would be passed into each FramedExample.
Flags: firefox-backlog+
Whiteboard: [faster]
Blocks: 1168848
Assignee: nobody → dmose
Iteration: --- → 41.3 - Jun 29
Target Milestone: --- → mozilla41
User Story: (updated)
Still needs a bit of documentation.
Note that this only fixes the problem in FramedExamples.  

In some other bug, we'll likely want to move all the Examples to FramedExamples so that this problem goes away completely.
Attachment #8621362 - Attachment is obsolete: true
Attachment #8622774 - Flags: review?(standard8)
I realize now that the patch here needs to be applied on top of the (not yet cleaned up) patch in bug 1168848.  I can either extract this one to be truly independent and land it first, or land them both together, once I've cleaned up the other patch. 

That said, this patch should be reviewable as-is, I think.
Rebased against recent fx-team.
Attachment #8622774 - Attachment is obsolete: true
Attachment #8622774 - Flags: review?(standard8)
This should apply cleanly to the fx-team branch, and fixes stuff I missed
the first time around.  It appears to be working as I would expect (it adds
dashed lines around many FramedExamples and the stylesheet isolation seems to be ok, however, there's a problem with the standalone footer not being styled
that I still need to debug, so I haven't yet requested review.
Attachment #8623257 - Attachment is obsolete: true
Attached patch Additional fixes for bug 1173909 (obsolete) — Splinter Review
I added some debugging and found out what was happening. Although you'd added cssClass to window.Frame, the props were being added on FramedExample, but FramedExample wasn't tying the two together. So I fixed that, and then also realised that we need to explicitly check this.props.cssClass is defined before trying to do comparisons against it.

I've also removed a couple of .bind statements - react was posting lots of warnings to the console about the fact it does it in a more optimised way.

These two patches combined seem to work fine now.
Comment on attachment 8623382 [details] [diff] [review]
Give loop showcase FramedExamples dashed borders and CSS style exclusion

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

r=Standard8 as long as you land this with my other patch. I'm quite happy for you to combine them into one.
Attachment #8623382 - Flags: review+
Combined patch for landing; carrying forward r=Standard8
Attachment #8623382 - Attachment is obsolete: true
Attachment #8623545 - Attachment is obsolete: true
Attachment #8623803 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/d42c1dc7fbc1
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: