Ignore:
Timestamp:
Jul 21, 2006, 11:50:24 AM (19 years ago)
Author:
ggaren
Message:

JavaScriptCore:

Reviewed by Darin.

  • Added support for strings that masquerade as undefined. Currently used by WebCore to implement undetectable style.filter.


The name is a little long, but it's only used in one line of code, so I
thought clarity should win over brevity.

  • JavaScriptCore.exp:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/object.h:
  • kjs/string_object.h: (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined): (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined): (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):

LayoutTests:

Test for undetectable style.filter property.

  • fast/dom/undetectable-style-filter-expected.txt: Added.
  • fast/dom/undetectable-style-filter.html: Added.

WebCore:

Reviewed by Darin.


  • Fixed <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)


  • Made style.filter undetectable, like document.all.


Unfortunately, the SVG spec-makers invented a CSS attribute named 'filter',
which conflicts with IE's custom CSS attribute by the same name. Web programs
like the Google maps API test for style.filter, and assume it's the IE
style.filter if they find it, so we need to make style.filter undetectable
to avoid breaking them.


An alternative solution would be to hotwire a delorean, go back in time,
and beg the web standards makers to make standards that work on the web.

  • bindings/js/kjs_css.cpp: (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/string_object.h

    r15468 r15557  
    4242    static JSValue *lengthGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot &slot);
    4343    static JSValue *indexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot &slot);
     44  };
     45
     46  // WebCore uses this to make style.filter undetectable
     47  class StringInstanceThatMasqueradesAsUndefined : public StringInstance {
     48  public:
     49      StringInstanceThatMasqueradesAsUndefined(JSObject* proto, const UString& string)
     50          : StringInstance(proto, string) { }
     51      virtual bool masqueradeAsUndefined() const { return true; }
     52      virtual bool toBoolean(ExecState*) const { return false; }
    4453  };
    4554
Note: See TracChangeset for help on using the changeset viewer.