Tapestry 5
  1. Tapestry 5
  2. TAP5-1708

Add ability to control where Ajax-injected CSS links are placed

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:

      Description

      JavaScriptSupport (and its predecessor, RenderSupport) was largely thought out in terms of linear page rendering, not piecemeal Ajax rendering. Unlike JavaScript which (if properly written) doesn't care about ordering, CSS is very ordering-centric.

      It is quite common for an application to include a CSS that overrides Tapestry defaults. Further, it is likely that certain components may want to have their own CSS to override defaults ... but an application CSS may also want to override those CSS rules as well.

      In an Ajax scenario, the component's CSS will be dynamically added to the page ... AFTER all existing CSS, including the theoretical application CSS that should be overriding the component CSS (theoretical in this discussion, actual in at least one of my clients).

      I think a first approach to resolving this would be to extend Tapestry so that a particular CSS link can be marked as the "insertion point". CSS added via Ajax would be inserted BEFORE the insertion point (if present) rather than at the end of the <head> element (as is done today).

        Activity

        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #592 (See https://builds.apache.org/job/tapestry-trunk-freestyle/592/)
        TAP5-1708: Add ability to control where Ajax-injected CSS links are placed
        TAP5-1708: Add support for marking a stylesheet link as the Ajax insertion point

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1186564
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ZoneDemo.tml
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/nested/zonedemo-overrides.css
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/nested/zonedemo-viaajax.css

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1186562
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PartialMarkupDocumentLinker.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetLink.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetOptions.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/stylesheet_insertion_point.txt
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #592 (See https://builds.apache.org/job/tapestry-trunk-freestyle/592/ ) TAP5-1708 : Add ability to control where Ajax-injected CSS links are placed TAP5-1708 : Add support for marking a stylesheet link as the Ajax insertion point hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1186564 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ZoneDemo.tml /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/nested/zonedemo-overrides.css /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/nested/zonedemo-viaajax.css hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1186562 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PartialMarkupDocumentLinker.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetLink.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/StylesheetOptions.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.java /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/stylesheet_insertion_point.txt
        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #598 (See https://builds.apache.org/job/tapestry-trunk-freestyle/598/)
        TAP5-1708: Add ability to control where Ajax-injected CSS links are placed

        One pixel error (':' instead of '.') for the case where there is no injection point resulted in undefined exceptions when an Ajax partial page render injected a CSS stylesheet.

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1187481
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #598 (See https://builds.apache.org/job/tapestry-trunk-freestyle/598/ ) TAP5-1708 : Add ability to control where Ajax-injected CSS links are placed One pixel error (':' instead of '.') for the case where there is no injection point resulted in undefined exceptions when an Ajax partial page render injected a CSS stylesheet. hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1187481 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development