Commit 0c692a4e authored by Helmut Hummel's avatar Helmut Hummel Committed by Benni Mack
Browse files

[TASK] Avoid referencing public assets across packages

Since TYPO3 core packages (extensions) are independently
published and might be installed in arbitrary file locations
in the near future, referencing assets in package A
from a CSS file package B will likely not work.

Therefore all assets that are referenced from a CSS
file are now moved to the package that contains this CSS file.

Also references of assets in CSS that already were located
in the same package are cleaned up to not assume a hard coded
path name (breaking out of Resources/Public directory).

Resolves: #95372
Releases: master
Change-Id: I6d7d7557d8ea7b293c81b50bc4172019a088f7b7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71332

Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 82958e39
......@@ -101,7 +101,7 @@ module.exports = function (grunt) {
},
core: {
files: {
"<%= paths.core %>Public/Css/errorpage.css": "<%= paths.sass %>errorpage.scss"
"<%= paths.backend %>Public/Css/errorpage.css": "<%= paths.sass %>errorpage.scss"
}
},
form: {
......@@ -633,7 +633,7 @@ module.exports = function (grunt) {
'flatpickr/flatpickr.min.js': 'flatpickr/dist/flatpickr.min.js',
'flatpickr/locales.js': 'flatpickr/dist/l10n/index.js',
'jquery.minicolors.js': '../node_modules/@claviska/jquery-minicolors/jquery.minicolors.min.js',
'../../Images/colorpicker/jquery.minicolors.png': '../node_modules/@claviska/jquery-minicolors/jquery.minicolors.png',
'../../../../../backend/Resources/Public/Images/colorpicker/jquery.minicolors.png': '../node_modules/@claviska/jquery-minicolors/jquery.minicolors.png',
/* disabled until autocomplete formatGroup is fixed to pass on the index too
'jquery.autocomplete.js': '../node_modules/devbridge-autocomplete/dist/jquery.autocomplete.min.js',
*/
......
......@@ -68,6 +68,9 @@
//
// Fonts
//
$fa-font-path: "../Fonts/FontAwesome";
$sourcesanspro-font-path: "../Fonts/SourceSansPro";
@import "webfont/sourcesanspro";
@import "font-awesome";
......
......@@ -40,7 +40,7 @@ $minicolors-panel-border-radius: $border-radius-base;
}
.minicolors-sprite {
background-image: url("#{$path-sysext}/core/Resources/Public/Images/colorpicker/jquery.minicolors.png");
background-image: url("../Images/colorpicker/jquery.minicolors.png");
}
//
......
......@@ -210,7 +210,7 @@ $svgColors: (
border: 1px solid map_get($svgColors, dragTooltipAlertBorder);
& .node-dd__ctrl-icon {
background-image: url(../../../../backend/Resources/Public/Images/pagetree-drag-place-denied.png);
background-image: url(../Images/pagetree-drag-place-denied.png);
}
}
......@@ -223,41 +223,41 @@ $svgColors: (
&--ok-below {
&.node-dd--copy .node-dd__ctrl-icon {
background-image: url(../../../../backend/Resources/Public/Images/pagetree-drag-copy-below.png);
background-image: url(../Images/pagetree-drag-copy-below.png);
}
.node-dd__ctrl-icon {
background-image: url(../../../../backend/Resources/Public/Images/pagetree-drag-move-below.png);
background-image: url(../Images/pagetree-drag-move-below.png);
}
}
&--ok-between {
&.node-dd--copy .node-dd__ctrl-icon {
background-image: url(../../../../backend/Resources/Public/Images/pagetree-drag-new-between.png);
background-image: url(../Images/pagetree-drag-new-between.png);
}
.node-dd__ctrl-icon {
background-image: url(../../../../backend/Resources/Public/Images/pagetree-drag-move-between.png);
background-image: url(../Images/pagetree-drag-move-between.png);
}
}
&--ok-append {
&.node-dd--copy .node-dd__ctrl-icon {
background-image: url(../../../../backend/Resources/Public/Images/pagetree-drag-new-inside.png);
background-image: url(../Images/pagetree-drag-new-inside.png);
}
.node-dd__ctrl-icon {
background-image: url(../../../../backend/Resources/Public/Images/pagetree-drag-move-into.png);
background-image: url(../Images/pagetree-drag-move-into.png);
}
}
&--ok-above {
&.node-dd--copy .node-dd__ctrl-icon {
background-image: url(../../../../backend/Resources/Public/Images/pagetree-drag-copy-above.png);
background-image: url(../Images/pagetree-drag-copy-above.png);
}
.node-dd__ctrl-icon {
background-image: url(../../../../backend/Resources/Public/Images/pagetree-drag-move-above.png);
background-image: url(../Images/pagetree-drag-move-above.png);
}
}
......
......@@ -7,8 +7,8 @@
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.eot?v=4.6.3');
src: url('../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.woff?v=4.6.3') format('woff'), url('../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.ttf?v=4.6.3') format('truetype'), url('../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');
src: url('../Fonts/FontAwesome/fontawesome-webfont.eot?v=4.6.3');
src: url('../Fonts/FontAwesome/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('../Fonts/FontAwesome/fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('../Fonts/FontAwesome/fontawesome-webfont.woff?v=4.6.3') format('woff'), url('../Fonts/FontAwesome/fontawesome-webfont.ttf?v=4.6.3') format('truetype'), url('../Fonts/FontAwesome/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
......
......@@ -234,7 +234,7 @@
.bg-transparent-emulation {
padding: 10px;
text-align: center;
background: url("#{$path-sysext}/install/Resources/Public/Images/bg_transparent_emulation.png");
background: url("../Images/bg_transparent_emulation.png");
img {
max-width: 300px;
......
......@@ -63,7 +63,7 @@ $page-ce-dropzone-possible-border: $state-success-border;
}
.t3-grid-cell-unassigned {
background: url('../../../../backend/Resources/Public/Images/Backgrounds/layout-not-assigned.png') repeat;
background: url('../Images/Backgrounds/layout-not-assigned.png') repeat;
}
//
......
......@@ -5,7 +5,7 @@
display: inline-block;
position: relative;
vertical-align: middle;
background-image: url('../../../../backend/Resources/Public/Icons/icon_fatalerror.gif');
background-image: url('../Icons/icon_fatalerror.gif');
background-repeat: no-repeat;
margin-right: 2px;
width: 16px;
......
//
// Global Variables
// ================
// Note: Need to be loaded after all LESS files are included to override variables defined before.
// Note: Use relative paths
//
//
// Paths
// =====
//
$path-root: "../../../../../..";
$path-sysext: "#{$path-root}/typo3/sysext";
//
// Fonts
// =====
//
$sourcesanspro-font-path: "#{$path-sysext}/backend/Resources/Public/Fonts/SourceSansPro";
$fa-font-path: "#{$path-sysext}/backend/Resources/Public/Fonts/FontAwesome";
// Note: Need to be loaded after all SCSS files are included to override variables defined before.
//
// Bootstrap
......
/*!
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
@font-face{font-family:FontAwesome;src:url(../Fonts/FontAwesome/fontawesome-webfont.eot?v=4.6.3);src:url(../Fonts/FontAwesome/fontawesome-webfont.eot?#iefix&v=4.6.3) format("embedded-opentype"),url(../Fonts/FontAwesome/fontawesome-webfont.woff2?v=4.6.3) format("woff2"),url(../Fonts/FontAwesome/fontawesome-webfont.woff?v=4.6.3) format("woff"),url(../Fonts/FontAwesome/fontawesome-webfont.ttf?v=4.6.3) format("truetype"),url(../Fonts/FontAwesome/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular) format("svg");font-weight:400;font-style:normal}body{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;line-height:1.5;color:#000;background-color:#fff;word-break:normal}*{margin:0;padding:0}p{margin-bottom:10px}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.callout-danger .media .fa-stack{color:#efc7c7}.callout-danger .media .fa-stack>.fa:first-child{color:#c83c3c}.fa-circle:before{content:"\f111"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-body{vertical-align:middle}.t3-message-page{background-color:#eee;display:table;position:absolute;top:0;left:0;width:100%;height:100%}.t3-message-page-container{max-width:600px;margin:auto}.typo3-error-image{max-width:150px;display:block;height:auto}.t3-error-wrap{display:table-cell;vertical-align:middle}.t3-message-page .t3-message-page-logo{margin:0 0 30px}#typo3-messages{margin-bottom:10px}#t3-footer{border-top:1px solid #5c5c5c}#t3-copyright-notice{text-align:justify;word-break:normal;color:#797878;margin-top:15px;font-size:10px}#t3-copyright-notice a{color:#797878;text-decoration:underline}#t3-copyright-notice a:hover{color:#b0b0b0}.callout{background-color:#f0f0f0;border-left:3px solid #ccc;margin:20px 0;padding:20px;color:#333}.callout a{color:#c83c3c}.callout-danger{background-color:#efc7c7;border-color:#c83c3c;color:#333}
\ No newline at end of file
......@@ -85,7 +85,7 @@ class ErrorPageController
$this->view->assign('errorCodeUrlPrefix', Typo3Information::URL_EXCEPTION);
$this->view->assign('errorCode', $errorCode);
$this->view->assign('logo', PathUtility::getAbsoluteWebPath(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Public/Images/typo3_orange.svg')));
$this->view->assign('cssFile', PathUtility::getAbsoluteWebPath(GeneralUtility::getFileAbsFileName('EXT:core/Resources/Public/Css/errorpage.css')));
$this->view->assign('cssFile', PathUtility::getAbsoluteWebPath(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Public/Css/errorpage.css')));
$this->view->assign('copyrightYear', GeneralUtility::makeInstance(Typo3Information::class)->getCopyrightYear());
return $this->view->render();
}
......
/*!
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
@font-face{font-family:FontAwesome;src:url(../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.eot?v=4.6.3);src:url(../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.eot?#iefix&v=4.6.3) format("embedded-opentype"),url(../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.woff2?v=4.6.3) format("woff2"),url(../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.woff?v=4.6.3) format("woff"),url(../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.ttf?v=4.6.3) format("truetype"),url(../../../../../../typo3/sysext/backend/Resources/Public/Fonts/FontAwesome/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular) format("svg");font-weight:400;font-style:normal}body{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;line-height:1.5;color:#000;background-color:#fff;word-break:normal}*{margin:0;padding:0}p{margin-bottom:10px}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.callout-danger .media .fa-stack{color:#efc7c7}.callout-danger .media .fa-stack>.fa:first-child{color:#c83c3c}.fa-circle:before{content:"\f111"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-body{vertical-align:middle}.t3-message-page{background-color:#eee;display:table;position:absolute;top:0;left:0;width:100%;height:100%}.t3-message-page-container{max-width:600px;margin:auto}.typo3-error-image{max-width:150px;display:block;height:auto}.t3-error-wrap{display:table-cell;vertical-align:middle}.t3-message-page .t3-message-page-logo{margin:0 0 30px}#typo3-messages{margin-bottom:10px}#t3-footer{border-top:1px solid #5c5c5c}#t3-copyright-notice{text-align:justify;word-break:normal;color:#797878;margin-top:15px;font-size:10px}#t3-copyright-notice a{color:#797878;text-decoration:underline}#t3-copyright-notice a:hover{color:#b0b0b0}.callout{background-color:#f0f0f0;border-left:3px solid #ccc;margin:20px 0;padding:20px;color:#333}.callout a{color:#c83c3c}.callout-danger{background-color:#efc7c7;border-color:#c83c3c;color:#333}
\ No newline at end of file
......@@ -32,7 +32,7 @@ class UriPrefixRenderingTest extends FunctionalTestCase
*/
private $definedResources = [
'absoluteCSS' => '/typo3/sysext/backend/Resources/Public/Css/backend.css',
'relativeCSS' => 'typo3/sysext/core/Resources/Public/Css/errorpage.css',
'relativeCSS' => 'typo3/sysext/backend/Resources/Public/Css/errorpage.css',
'extensionCSS' => 'EXT:rte_ckeditor/Resources/Public/Css/contents.css',
'externalCSS' => 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css',
'absoluteJS' => '/typo3/sysext/backend/Resources/Public/JavaScript/backend.js',
......@@ -46,7 +46,7 @@ class UriPrefixRenderingTest extends FunctionalTestCase
* @var string[]
*/
private $resolvedResources = [
'relativeCSS' => 'typo3/sysext/core/Resources/Public/Css/errorpage.css',
'relativeCSS' => 'typo3/sysext/backend/Resources/Public/Css/errorpage.css',
'extensionCSS' => 'typo3/sysext/rte_ckeditor/Resources/Public/Css/contents.css',
'externalCSS' => 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css',
'relativeJS' => 'typo3/sysext/core/Resources/Public/JavaScript/Contrib/autosize.js',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment