Closed Bug 1014501 Opened 11 years ago Closed 11 years ago

[WebComponents] style import polyfill

Categories

(Firefox OS Graveyard :: Gaia, defect)

x86
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.0 S3 (6june)

People

(Reporter: wilsonpage, Assigned: kgrandon)

Details

(Whiteboard: [p=2],[systemsfe])

Attachments

(3 files, 1 obsolete file)

There is currently a bug in platform that inconsistently renders styling when @import statements are used inside shadow-dom templates. Styling does work correctly when directly inlined in the template. If we can incorporate CSS inlining into custom-element templates then we can work around this platform bug and implement web-components in Gaia sooner. This build step will reduce requests at app runtime, so we may choose to keep it around even when the platform is fixed (needs discussion).
Platform bug 1003294
I might take a look at this later, but I would love it if someone wants to free me from the pain that this will be :)
Flags: needinfo?(kgrandon)
Assignee: nobody → kgrandon
Flags: needinfo?(kgrandon)
Attached file Work in progress (obsolete) —
Summary: Inline custom-element @import CSS statements in build step → [WebComponents] style import polyfill
Attached file Github pull request
Attachment #8427644 - Attachment is obsolete: true
Comment on attachment 8428178 [details] [review] Github pull request Here is an alternate pull request which requires the inclusion of shared/js/component_utils.js for the time being. I think this is an acceptable approach for now, and I can file a bug to inline this automatically at build step if desired. I have a patch that can inline this file everywhere, but the build system is currently undergoing refactoring and a backout there just obsoleted my patch =/ Wilson, Yan - what do you guys think?
Attachment #8428178 - Attachment description: Git → Github pull request
Attachment #8428178 - Flags: review?(yor)
Attachment #8428178 - Flags: review?(wilsonpage)
Comment on attachment 8428178 [details] [review] Github pull request Looks good.
Attachment #8428178 - Flags: review?(yor) → review+
It doesn't seem to resolve bug 1003294 though. While the demo page works fine, if I put the demo page inside gaia (disguised as wallpaper/pick.html), the rendering is still inconsistent.
Hmm, ok. Let me verify again and maybe try another approach. I tested and was not able to reproduce, but I only tested with a single component, not all of the examples.
(In reply to Yan Or from comment #7) > Created attachment 8428326 [details] > Screen Shot 2014-05-24 at 2.32.09 PM.png > > It doesn't seem to resolve bug 1003294 though. While the demo page works > fine, if I put the demo page inside gaia (disguised as wallpaper/pick.html), > the rendering is still inconsistent. Yan - can you provide the exact content of your test page? I tested this patch on a device, and could not reproduce. I am fairly confident that this resolves the issue, so I am going to land in master for now so Wilson/Aranau can test it as well. (If there's any reason it doesn't work I'll gladly back it out). I'm also thinking we should write a simple test app which embeds all of the examples so we all have some simple test pages to use. Landed: https://github.com/mozilla-b2g/gaia/commit/f5b559ff148709c689f2f38e46a47dff1e14c42b
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Attached file Test page
Yan - here is the test page that I used that should work with the latest master. Could you compare it to yours and try it to see if it works for you? Thanks!
Flags: needinfo?(yor)
Whiteboard: [p=2],[systemsfe]
Target Milestone: --- → 2.0 S3 (6june)
Kevin, still seeing the problem. Here are the steps I did: 1. Get the latest master 2. Create a file "gaia-header-demo.html" with your test page contents under apps/wallpapers 3. DEBUG=1 make 4. Run firefox nightly (latest) with the debug profile and -no-remote 5. Open http://wallpaper.gaiamobile.org:8080/gaia-header-demo.html 6. Still seeing inconsistent rendering - refresh will render random headers correctly I have not tried on a device. Should I not use firefox nightly? I find it easier to debug.
Flags: needinfo?(yor) → needinfo?(kgrandon)
Ok, I will do some verification in Firefox Nightly this week. It's something we should support, but solving this on a device is the most important thing (so we can actually use it this release).
Flags: needinfo?(kgrandon)
I ran one of the ported app (Wallpaper) on a device with the latest master and cannot constantly reproduce the problem. It happened the first time but then rendered correctly afterward - rebooting the device could not repeat the first time error. Will report back if I see it on a more complicated app.
gmarty tried a variation of this fix in his gaia-header work and said that it worked on desktop, but not on device.
Flags: needinfo?(gmarty)
Attachment #8428178 - Flags: review?(wilsonpage)
Please send me a test page that is not working for you on a device and I will take a look. Thanks!
Kevin, I ran into a possibly related problem when porting the browser app. Here's the PR: https://github.com/mozilla-b2g/gaia/pull/19700 The "Settings" header doesn't show up with this. The slight difference here is that the HTML block is delay loaded. However, the same case works with fine with the "Edit Bookmark" header.
Hmm, ok. Perhaps there is some problem when using a "delayed" load. ni? on myself to take another look.
Flags: needinfo?(kgrandon)
Appears that pull request is outdated and has merge conflicts. I'll check again once it's been rebased. In the meantime I will try reproducing locally, and if you have a small isolated testcase I will take a look again.
Flags: needinfo?(kgrandon)
Ok, rebased. Try now.
Right - that sounds like bug 1007743 which was not a goal of this bug. That bug has a patch, so we can see if we can land it in the next few days. If we can't, I can work on a workaround for that bug as well.
Flags: needinfo?(gmarty)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: