103 * defined by an element are not well defined. For example, the html |
103 * defined by an element are not well defined. For example, the html |
104 * <code><body bgcolor=red></code> makes the body have a red |
104 * <code><body bgcolor=red></code> makes the body have a red |
105 * background. But if the html file also contains the CSS rule |
105 * background. But if the html file also contains the CSS rule |
106 * <code>body { background: blue }</code> it becomes less clear as to |
106 * <code>body { background: blue }</code> it becomes less clear as to |
107 * what color the background of the body should be. The current |
107 * what color the background of the body should be. The current |
108 * implemention gives visual attributes defined in the element the |
108 * implementation gives visual attributes defined in the element the |
109 * highest precedence, that is they are always checked before any styles. |
109 * highest precedence, that is they are always checked before any styles. |
110 * Therefore, in the previous example the background would have a |
110 * Therefore, in the previous example the background would have a |
111 * red color as the body element defines the background color to be red. |
111 * red color as the body element defines the background color to be red. |
112 * <p> |
112 * <p> |
113 * As already mentioned this supports CSS. We don't support the full CSS |
113 * As already mentioned this supports CSS. We don't support the full CSS |
936 } |
936 } |
937 |
937 |
938 /** |
938 /** |
939 * Sets the base font size from the passed in String. The string |
939 * Sets the base font size from the passed in String. The string |
940 * can either identify a specific font size, with legal values between |
940 * can either identify a specific font size, with legal values between |
941 * 1 and 7, or identifiy a relative font size such as +1 or -2. |
941 * 1 and 7, or identify a relative font size such as +1 or -2. |
942 */ |
942 */ |
943 public void setBaseFontSize(String size) { |
943 public void setBaseFontSize(String size) { |
944 css.setBaseFontSize(size); |
944 css.setBaseFontSize(size); |
945 } |
945 } |
946 |
946 |
2957 } |
2957 } |
2958 } |
2958 } |
2959 return true; |
2959 return true; |
2960 } |
2960 } |
2961 if (thisDotIndex != -1) { |
2961 if (thisDotIndex != -1) { |
2962 // Reciever references a class, just check element name. |
2962 // Receiver references a class, just check element name. |
2963 return (((thisDotIndex - thisCurrent) == (sLast - sCurrent)) && |
2963 return (((thisDotIndex - thisCurrent) == (sLast - sCurrent)) && |
2964 selector.regionMatches(sCurrent, name, thisCurrent, |
2964 selector.regionMatches(sCurrent, name, thisCurrent, |
2965 thisDotIndex - thisCurrent)); |
2965 thisDotIndex - thisCurrent)); |
2966 } |
2966 } |
2967 if (thisPoundIndex != -1) { |
2967 if (thisPoundIndex != -1) { |
2968 // Reciever references an id, just check element name. |
2968 // Receiver references an id, just check element name. |
2969 return (((thisPoundIndex - thisCurrent) ==(sLast - sCurrent))&& |
2969 return (((thisPoundIndex - thisCurrent) ==(sLast - sCurrent))&& |
2970 selector.regionMatches(sCurrent, name, thisCurrent, |
2970 selector.regionMatches(sCurrent, name, thisCurrent, |
2971 thisPoundIndex - thisCurrent)); |
2971 thisPoundIndex - thisCurrent)); |
2972 } |
2972 } |
2973 // Fail through, no classes or ides, just check string. |
2973 // Fail through, no classes or ides, just check string. |
2975 selector.regionMatches(sCurrent, name, thisCurrent, |
2975 selector.regionMatches(sCurrent, name, thisCurrent, |
2976 thisLast - thisCurrent)); |
2976 thisLast - thisCurrent)); |
2977 } |
2977 } |
2978 |
2978 |
2979 /** |
2979 /** |
2980 * Similiar to String.indexOf, but allows an upper bound |
2980 * Similar to String.indexOf, but allows an upper bound |
2981 * (this is slower in that it will still check string starting at |
2981 * (this is slower in that it will still check string starting at |
2982 * start. |
2982 * start. |
2983 */ |
2983 */ |
2984 int boundedIndexOf(String string, char search, int start, |
2984 int boundedIndexOf(String string, char search, int start, |
2985 int end) { |
2985 int end) { |