Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ css-module-displayname-logical=Logical properties and values
css-module-displayname-overflow=Overflow
css-module-displayname-filter_effects=Filter Effects
css-module-displayname-scroll_snap=Scroll Snap
css-module-displayname-images_4=Images Module Level 4

completion-help-no-documentation-found=No documentation found

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public class DefaultCssEditorModule extends CssEditorModule {
module("positioning", "http://www.w3.org/TR/css-position-3"), //NOI18N
module("overflow", "http://www.w3.org/TR/css-overflow-3"), //NOI18N
module("scroll_snap", "http://www.w3.org/TR/css-scroll-snap-1"), //NOI18N
module("images_4", "http://www.w3.org/TR/css-images-4/"), //NOI18N
module("sizing", "http://www.w3.org/TR/css-sizing-3"), //NOI18N
module("contain", "http://www.w3.org/TR/css-contain-3"), //NOI18N
module("other", null) //NOI18N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

$category=images

@image=<uri> | <image-list> | <element-reference> | <image-combination> | <gradient>
@image=<uri> | <image-list> | <image-set> | <element-reference> | <image-combination> | <gradient>

@image-list=image ( [ [ [<image-decl> , ]* [ <image-decl>] ] | <color> ] )

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# CSS Images Module Level 4

$category=images_4

@image-set = image-set ( <image-set-option> [, <image-set-option> ]* )

@image-set-option = [<image> | <string>] [<resolution> | <image-file-type>]?

@image-file-type = type ( <string> )
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.modules.css.editor.module.main;

public class Images4Test extends CssModuleTestBase {

public Images4Test(String testName) {
super(testName);
}

public void testImageSetProperty() {
assertPropertyDeclaration("background-image: image-set(\"picture.png\" 1x)");
assertPropertyDeclaration("background-image: image-set(\"picture.png\" type(\"image/avif\"), \"foo.jpg\" type(\"image/jpeg\"))");
assertPropertyDeclaration("background-image: image-set( linear-gradient(cornflowerblue, white) 1x, url(\"detailed-gradient.png\") 3x );");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testListStyleCompletion() {
"upper-roman","!uri","cross-fade","radial-gradient", "conic-gradient",
"inside", "decimal-leading-zero","square", "circle","none",
"symbols", "outside", "initial", "inherit", "unset", "revert",
"var");
"image-set", "var");
}

public void testListStyleType() {
Expand All @@ -74,7 +74,7 @@ public void testListStyleTypeCompletion() {
"repeating-linear-gradient", "element", "numeric", "linear-gradient",
"!string", "alphabetic", "image", "symbolic", "repeating-radial-gradient",
"!uri", "repeating", "cross-fade", "non-repeating", "radial-gradient",
"conic-gradient", "var");
"conic-gradient", "image-set", "var");
}

public void testListStyleImage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public enum PropertyCategory {
GRID,
HYPERLINKS,
IMAGES,
IMAGES_4,
LINE,
LISTS_AND_COUNTERS,
LOGICAL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Collection<String> getFixedImageTokens() {

public static class Resolution extends NumberPostfixAcceptor {

private static final List<String> POSTFIXES = Arrays.asList(new String[]{"dpi", "dppx", "dpcm"}); //NOI18N
private static final List<String> POSTFIXES = Arrays.asList(new String[]{"dpi", "dppx", "dpcm", "x"}); //NOI18N

public Resolution(String id) {
super(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public void testTheBackgroundCase() {
"repeat", "!length", "-", "repeating-radial-gradient", "space", "!percentage",
"fixed", "border-box", "center", "no-repeat", "none", "left", "right",
"top", "element", "scroll", "repeat-y", "linear-gradient", "repeat-x",
"image", "!uri", "cross-fade", "radial-gradient", "conic-gradient", "bottom", "local",
"image", "image-set", "!uri", "cross-fade", "radial-gradient", "conic-gradient", "bottom", "local",
"calc", "var", "mod", "log", "cos", "sign", "atan", "min", "sqrt",
"hypot", "sin", "pow", "rem", "exp", "clamp", "atan2", "tan", "max",
"acos", "abs", "asin");
Expand All @@ -301,7 +301,7 @@ public void testTheBackgroundCase2() {
assertResolve(p.getGrammar(), "aliceblue bottom / auto");
assertAlternatives(p.getGrammar(), "aliceblue bottom / auto",
"repeating-linear-gradient", "element", "padding-box", "scroll", ""
+ "content-box", "repeat-y", "linear-gradient", "repeat-x", "image",
+ "content-box", "repeat-y", "linear-gradient", "repeat-x", "image", "image-set",
"round", "!length", "-", "repeat", "repeating-radial-gradient", "space",
"fixed", "!percentage", "!uri", "border-box", "cross-fade",
"radial-gradient", "conic-gradient", "no-repeat", "auto", "none", "local", "calc",
Expand Down
Loading