aboutsummaryrefslogtreecommitdiffstats
path: root/gwtquery-core/src/main/java/com/google/gwt/query/QueryMin.gwt.xml
blob: f21b6ba51bfcbe7dce1e4a622e35b22512736468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!--
  Copyright 2011, The gwtquery team.

  Licensed 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.
-->

<!-- Include com.google.gwt.query.QueryMin instead of com.google.gwt.query.Query-->
<!-- if you want small javascript code and you are not using any of the selectors: -->
<!-- ".*(:contains|!=|:checked|:not|:nth-|:last-|:only-).*"-->
<!-- Note: that this will increase the number of total permutations. -->
<module>

    <!-- Inherit GQuery module -->
    <inherits name='com.google.gwt.query.Query'/>

    <source path="client"/>
    <super-source path="super"/>

    <!-- Detect whether querySelectorAll is available -->
    <define-property name="selectorCapability" values="native,js"/>
    <property-provider name="selectorCapability">
        <![CDATA[
         return !/_force_no_native/.test(document.location.search) &&
                typeof document.querySelectorAll == 'function' ? 'native' : 'js';
        ]]>
    </property-provider>

    <set-property name="selectorCapability" value="js" >
        <when-property-is name="user.agent" value="ie6" />
    </set-property>
    <set-property name="selectorCapability" value="native" >
        <when-property-is name="user.agent" value="safari" />
    </set-property>

    <!-- Selector Engines -->
    <replace-with class="com.google.gwt.query.client.impl.SelectorEngineNativeMin">
        <when-type-assignable class="com.google.gwt.query.client.impl.SelectorEngineImpl"/>
        <any>
            <when-property-is name="user.agent" value="gecko1_8"/>
            <when-property-is name="user.agent" value="opera"/>
            <when-property-is name="user.agent" value="safari"/>
        </any>
        <when-property-is name="selectorCapability" value="native"/>
    </replace-with>
    <replace-with class="com.google.gwt.query.client.impl.SelectorEngineCssToXPath">
        <when-type-assignable class="com.google.gwt.query.client.impl.SelectorEngineImpl"/>
        <any>
            <when-property-is name="user.agent" value="gecko1_8"/>
            <when-property-is name="user.agent" value="opera"/>
            <when-property-is name="user.agent" value="safari"/>
        </any>
        <when-property-is name="selectorCapability" value="js"/>
    </replace-with>
    <replace-with class="com.google.gwt.query.client.impl.SelectorEngineNativeMinIE8">
        <when-type-assignable class="com.google.gwt.query.client.impl.SelectorEngineImpl"/>
        <any>
            <when-property-is name="user.agent" value="ie8"/>
            <when-property-is name="user.agent" value="ie9"/>
            <when-property-is name="user.agent" value="ie10"/>
        </any>
        <when-property-is name="selectorCapability" value="native"/>
    </replace-with>
</module>