? Success

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
10 Apr 2016

Pull Request for Improvement.

Summary of Changes

This PR improves inline js/css rendering in HTML5.

In HTML5 there are default type for:

  • script tag: text/javascript
  • style tag: text/css

So they are not needing when the document is rendered in HTML5.

Joomla already removes them in HTML5 for external js/css files, but not for inline js/css.
This PR improves that.

Testing Instructions

  • Use latest staging
  • Go to protostar homepage and view source. You will get some
<script type="text/javascript">[...]</script>
  • Apply patch
  • You willl now get
<script>[...]</script>

To test the style tag you can add to your protostar index.php file, for instance:

$doc->addStyleDeclaration('p {margin:0}');

That should be rendered, after the patch. as

<style>
p {margin:0}
</style>

Also check code difference.

avatar andrepereiradasilva andrepereiradasilva - open - 10 Apr 2016
avatar andrepereiradasilva andrepereiradasilva - change - 10 Apr 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Apr 2016
Labels Added: ?
avatar franz-wohlkoenig franz-wohlkoenig - test_item - 11 Apr 2016 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 11 Apr 2016

I have tested this item :white_check_mark: successfully on 20a41a8

Tested script and style tag on protostar, both working als described.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9843.

avatar brianteeman brianteeman - change - 11 Apr 2016
Category Code style
avatar waader
waader - comment - 15 Apr 2016

In protostar this block is rendered unchanged:
<style type="text/css">
h1,h2,h3,h4,h5,h6,.site-title{
font-family: 'Open Sans', sans-serif;
}
</style>

Also in Beez there is this unchanged block:

<script type="text/javascript">
var big = '72%';
var small = '53%';
var bildauf = '/joomla36/templates/beez3/images/plus.png';
var bildzu = '/joomla36/templates/beez3/images/minus.png';
var rightopen = 'Open info';
var rightclose = 'Close info';
var altopen = 'is open';
var altclose = 'is closed';
</script>

avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Apr 2016

@waader that's true. That happens because someone didn't use the Joomla API to load the style and javascript.
See, for instance, https://github.com/joomla/joomla-cms/blob/staging/templates/protostar/index.php#L98-L103 for protostar.

But that as nothing to do with this PR does.

avatar waader waader - test_item - 15 Apr 2016 - Tested successfully
avatar waader
waader - comment - 15 Apr 2016

I have tested this item :white_check_mark: successfully on 20a41a8

Thanks for the explanation!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9843.

avatar andrepereiradasilva
andrepereiradasilva - comment - 16 Apr 2016
avatar brianteeman brianteeman - change - 17 Apr 2016
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 17 Apr 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9843.

avatar joomla-cms-bot joomla-cms-bot - change - 17 Apr 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 17 Apr 2016
Milestone Added:
avatar rdeutz rdeutz - close - 2 May 2016
avatar rdeutz rdeutz - merge - 2 May 2016
avatar joomla-cms-bot joomla-cms-bot - close - 2 May 2016
avatar rdeutz rdeutz - change - 2 May 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-05-02 06:08:03
Closed_By rdeutz
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment