Changeset 15984 in josm for trunk/src/org


Ignore:
Timestamp:
2020-03-01T23:35:58+01:00 (5 years ago)
Author:
simon04
Message:

see #18802 - Add MapCSSRule.matches

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r15983 r15984  
    702702            MapCSSRule r = candidates.next();
    703703            env.clearSelectorMatchingInformation();
    704             if (r.selector.matches(env)) { // as side effect env.parent will be set (if s is a child selector)
     704            if (r.matches(env)) { // as side effect env.parent will be set (if s is a child selector)
    705705                TagCheck check = indexData.getCheck(r);
    706706                if (check != null) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java

    r15983 r15984  
    3535
    3636    /**
     37     * Test whether the selector of this rule applies to the primitive.
     38     *
     39     * @param env the Environment. env.mc and env.layer are read-only when matching a selector.
     40     * env.source is not needed. This method will set the matchingReferrers field of env as
     41     * a side effect! Make sure to clear it before invoking this method.
     42     * @return true, if the selector applies
     43     * @see Selector#matches
     44     */
     45    public boolean matches(Environment env) {
     46        return selector.matches(env);
     47    }
     48
     49    /**
    3750     * <p>Executes the instructions against the environment {@code env}</p>
    3851     *
    3952     * @param env the environment
     53     * @see Declaration#execute
    4054     */
    4155    public void execute(Environment env) {
Note: See TracChangeset for help on using the changeset viewer.