Changeset 94369 in webkit
- Timestamp:
- Sep 1, 2011 5:18:17 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 20 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r94367 r94369 1 2011-09-01 Julien Chaffraix <jchaffraix@webkit.org> 2 3 REGRESSION (r84327-r84329): CSS stylesheets fail to load on www.flagstar.com login page 4 https://bugs.webkit.org/show_bug.cgi?id=65140 5 6 Reviewed by Darin Adler. 7 8 * fast/css/stylesheet-enable-first-alternate-link-expected.txt: Added. 9 * fast/css/stylesheet-enable-first-alternate-link.html: Added. 10 * fast/css/stylesheet-enable-first-alternate-on-load-link-expected.txt: Added. 11 * fast/css/stylesheet-enable-first-alternate-on-load-link.html: Added. 12 * fast/css/stylesheet-enable-first-alternate-on-load-sheet-expected.txt: Added. 13 * fast/css/stylesheet-enable-first-alternate-on-load-sheet.html: Added. 14 * fast/css/stylesheet-enable-second-alternate-link-expected.txt: Added. 15 * fast/css/stylesheet-enable-second-alternate-link.html: Added. 16 * fast/css/stylesheet-enable-second-alternate-on-load-link-expected.txt: Added. 17 * fast/css/stylesheet-enable-second-alternate-on-load-link.html: Added. 18 * fast/css/stylesheet-enable-second-alternate-on-load-sheet-expected.txt: Added. 19 * fast/css/stylesheet-enable-second-alternate-on-load-sheet.html: Added. 20 * http/tests/css/link-css-disabled-value-with-slow-loading-sheet-expected.txt: Added. 21 * http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error-expected.txt: Added. 22 * http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error.html: Added. 23 * http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html: Added. 24 * http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet-in-error.js: Added. 25 (onSheetLoaded): 26 (testWhenLoaded): 27 * http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet.js: Added. 28 (onSheetLoaded): 29 (testWhenLoaded): 30 * http/tests/css/resources/slow-loading-sheet-in-error.php: Added. 31 * http/tests/css/resources/slow-loading-sheet.php: Added. 32 New tests developped for 65140. The baselines matches what FF and Opera are doing (IE does not support 33 link.sheet at the moment). Those failures are covered by bug 67436. 34 35 * fast/css/link-disabled-attr-expected.txt: 36 * fast/dom/HTMLLinkElement/disabled-attribute-expected.txt: 37 Fixed the baseline to match our behavior. The FAIL are our current deviation from the spec. Those 38 failures are covered by bug 67436. 39 40 * fast/dom/boolean-attribute-reflection-expected.txt: 41 * fast/dom/script-tests/boolean-attribute-reflection.js: 42 Re-added link.disabled as a reflected attribute. 43 1 44 2011-09-01 Ryosuke Niwa <rniwa@webkit.org> 2 45 -
trunk/LayoutTests/fast/css/link-disabled-attr-expected.txt
r93439 r94369 4 4 notsheet 5 5 PASS link.sheet is null 6 PASS link.disabled is false 6 FAIL link.disabled should be false. Was true. 7 7 sheet 8 8 PASS link.sheet is non-null. 9 PASS link.disabled is true 9 FAIL link.disabled should be true. Was false. 10 10 PASS link.sheet.disabled is true 11 11 PASS getComputedStyle(console).whiteSpace is 'normal' 12 12 PASS link.disabled is false 13 PASS link.sheet.disabled is false 14 PASS getComputedStyle(console).whiteSpace is 'pre-wrap' 13 FAIL link.sheet.disabled should be false. Was true. 14 FAIL getComputedStyle(console).whiteSpace should be pre-wrap. Was normal. 15 15 altsheet 16 16 FAIL link.disabled should be true. Was false. -
trunk/LayoutTests/fast/dom/HTMLLinkElement/disabled-attribute-expected.txt
r84329 r94369 6 6 PASS test.disabled is false 7 7 PASS test.disabled is true 8 PASS test.sheet.disabled is true 8 FAIL test.sheet.disabled should be true. Was false. 9 9 PASS test.sheet.disabled is false 10 PASS test.disabled is false 10 FAIL test.disabled should be false. Was true. 11 11 12 12 13 13 PASS test_nostyle.sheet is null 14 14 PASS test_nostyle.disabled is false 15 PASS test_nostyle.disabled is false 15 FAIL test_nostyle.disabled should be false. Was true. 16 16 PASS successfullyParsed is true 17 17 -
trunk/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt
r84329 r94369 60 60 PASS e = make('input'); e.setAttribute('required', 'x'); e.required = false; e.getAttribute('required') is null 61 61 PASS e = make('input'); e.setAttribute('required', 'x'); e.required = true; e.getAttribute('required') is '' 62 PASS e = make('link'); e.removeAttribute('disabled'); e.disabled is false 63 PASS e = make('link'); e.setAttribute('disabled', ''); e.disabled is true 64 PASS e = make('link'); e.setAttribute('disabled', 'x'); e.disabled = false; e.getAttribute('disabled') is null 65 PASS e = make('link'); e.setAttribute('disabled', 'x'); e.disabled = true; e.getAttribute('disabled') is '' 62 66 PASS e = make('menu'); e.removeAttribute('compact'); e.compact is false 63 67 PASS e = make('menu'); e.setAttribute('compact', ''); e.compact is true -
trunk/LayoutTests/fast/dom/script-tests/boolean-attribute-reflection.js
r84329 r94369 16 16 [ "input", "readOnly" ], 17 17 [ "input", "required" ], 18 [ "link", "disabled" ], 18 19 [ "menu", "compact" ], 19 20 [ "object", "declare" ], -
trunk/Source/WebCore/ChangeLog
r94368 r94369 1 2011-09-01 Julien Chaffraix <jchaffraix@webkit.org> 2 3 REGRESSION (r84327-r84329): CSS stylesheets fail to load on www.flagstar.com login page 4 https://bugs.webkit.org/show_bug.cgi?id=65140 5 6 Reviewed by Darin Adler. 7 8 Tests: fast/css/stylesheet-enable-first-alternate-link.html 9 fast/css/stylesheet-enable-first-alternate-on-load-link.html 10 fast/css/stylesheet-enable-first-alternate-on-load-sheet.html 11 fast/css/stylesheet-enable-second-alternate-link.html 12 fast/css/stylesheet-enable-second-alternate-on-load-link.html 13 fast/css/stylesheet-enable-second-alternate-on-load-sheet.html 14 http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error.html 15 http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html 16 17 This patch basically reverts 88479 and 84329 while keeping the tests 18 we developped during the implementation. 19 20 Following discussion, it looks like HTML5 will need to be amended. 21 In the meantime, we will just revert the changes so that we can come 22 up with a better change. 23 24 * dom/Document.cpp: 25 (WebCore::Document::recalcStyleSelector): 26 * html/HTMLLinkElement.cpp: 27 (WebCore::HTMLLinkElement::HTMLLinkElement): 28 (WebCore::HTMLLinkElement::setDisabledState): 29 (WebCore::HTMLLinkElement::parseMappedAttribute): 30 (WebCore::HTMLLinkElement::process): 31 Revert those method to their original content. 32 33 * html/HTMLLinkElement.h: 34 (WebCore::HTMLLinkElement::isDisabled): 35 (WebCore::HTMLLinkElement::isEnabledViaScript): 36 (WebCore::HTMLLinkElement::isAlternate): 37 Re-introduced the DisabledState enum. 38 39 * html/HTMLLinkElement.idl: |disabled| is Reflect'ed again. 40 1 41 2011-09-01 Dan Bernstein <mitz@apple.com> 2 42 -
trunk/Source/WebCore/dom/Document.cpp
r94290 r94369 2960 2960 // <LINK> element 2961 2961 HTMLLinkElement* linkElement = static_cast<HTMLLinkElement*>(n); 2962 if (linkElement-> disabled())2962 if (linkElement->isDisabled()) 2963 2963 continue; 2964 2964 enabledViaScript = linkElement->isEnabledViaScript(); -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r94213 r94369 56 56 , m_linkLoader(this) 57 57 , m_sizes(DOMSettableTokenList::create()) 58 , m_disabledState(Unset) 58 59 , m_loading(false) 59 , m_isEnabledViaScript(false)60 60 , m_createdByParser(createdByParser) 61 61 , m_isInShadowTree(false) … … 84 84 } 85 85 86 void HTMLLinkElement::setDisabled(bool disabled) 87 { 88 if (!m_sheet) 89 return; 90 91 bool wasDisabled = m_sheet->disabled(); 92 if (wasDisabled == disabled) 93 return; 94 95 m_sheet->setDisabled(disabled); 96 m_isEnabledViaScript = !disabled; 97 98 // If we change the disabled state while the sheet is still loading, then we have to 99 // perform three checks: 100 if (isLoading()) { 101 // Check #1: The sheet becomes disabled while loading. 102 if (disabled) 103 removePendingSheet(); 104 105 // Check #2: An alternate sheet becomes enabled while it is still loading. 106 if (m_relAttribute.m_isAlternate && !disabled) 107 addPendingSheet(Blocking); 108 109 // Check #3: A main sheet becomes enabled while it was still loading and 110 // after it was disabled via script. It takes really terrible code to make this 111 // happen (a double toggle for no reason essentially). This happens on 112 // virtualplastic.net, which manages to do about 12 enable/disables on only 3 113 // sheets. :) 114 if (!m_relAttribute.m_isAlternate && !disabled && wasDisabled) 115 addPendingSheet(Blocking); 116 117 // If the sheet is already loading just bail. 118 return; 119 } 120 121 if (!disabled) 122 process(); 86 void HTMLLinkElement::setDisabledState(bool disabled) 87 { 88 DisabledState oldDisabledState = m_disabledState; 89 m_disabledState = disabled ? Disabled : EnabledViaScript; 90 if (oldDisabledState != m_disabledState) { 91 // If we change the disabled state while the sheet is still loading, then we have to 92 // perform three checks: 93 if (isLoading()) { 94 // Check #1: The sheet becomes disabled while loading. 95 if (m_disabledState == Disabled) 96 removePendingSheet(); 97 98 // Check #2: An alternate sheet becomes enabled while it is still loading. 99 if (m_relAttribute.m_isAlternate && m_disabledState == EnabledViaScript) 100 addPendingSheet(Blocking); 101 102 // Check #3: A main sheet becomes enabled while it was still loading and 103 // after it was disabled via script. It takes really terrible code to make this 104 // happen (a double toggle for no reason essentially). This happens on 105 // virtualplastic.net, which manages to do about 12 enable/disables on only 3 106 // sheets. :) 107 if (!m_relAttribute.m_isAlternate && m_disabledState == EnabledViaScript && oldDisabledState == Disabled) 108 addPendingSheet(Blocking); 109 110 // If the sheet is already loading just bail. 111 return; 112 } 113 114 // Load the sheet, since it's never been loaded before. 115 if (!m_sheet && m_disabledState == EnabledViaScript) 116 process(); 117 else 118 document()->styleSelectorChanged(DeferRecalcStyle); // Update the style selector. 119 } 123 120 } 124 121 … … 146 143 m_media = attr->value().string().lower(); 147 144 process(); 148 } else if (attr->name() == onbeforeloadAttr) 145 } else if (attr->name() == disabledAttr) 146 setDisabledState(!attr->isNull()); 147 else if (attr->name() == onbeforeloadAttr) 149 148 setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr)); 150 149 #if ENABLE(LINK_PREFETCH) … … 186 185 bool acceptIfTypeContainsTextCSS = document()->page() && document()->page()->settings() && document()->page()->settings()->treatsAnyTextCSSLinkAsStylesheet(); 187 186 188 if ( !disabled()&& (m_relAttribute.m_isStyleSheet || (acceptIfTypeContainsTextCSS && type.contains("text/css")))187 if (m_disabledState != Disabled && (m_relAttribute.m_isStyleSheet || (acceptIfTypeContainsTextCSS && type.contains("text/css"))) 189 188 && document()->frame() && m_url.isValid()) { 190 189 … … 445 444 } 446 445 447 bool HTMLLinkElement::disabled() const448 {449 return m_sheet && m_sheet->disabled();450 }451 452 446 DOMSettableTokenList* HTMLLinkElement::sizes() const 453 447 { -
trunk/Source/WebCore/html/HTMLLinkElement.h
r93439 r94369 58 58 // FIXME: This should be renamed isStyleSheetLoading as this is only used for stylesheets. 59 59 bool isLoading() const; 60 bool isEnabledViaScript() const { return m_isEnabledViaScript; } 61 bool disabled() const;62 void setDisabled(bool);60 61 bool isDisabled() const { return m_disabledState == Disabled; } 62 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript; } 63 63 void setSizes(const String&); 64 64 DOMSettableTokenList* sizes() const; … … 82 82 virtual void linkLoadingErrored(); 83 83 84 bool isAlternate() const { return m_ relAttribute.m_isAlternate; }84 bool isAlternate() const { return m_disabledState == Unset && m_relAttribute.m_isAlternate; } 85 85 86 void setDisabledState(bool); 87 86 88 virtual bool isURLAttribute(Attribute*) const; 87 89 … … 101 103 CachedResourceHandle<CachedCSSStyleSheet> m_cachedSheet; 102 104 RefPtr<CSSStyleSheet> m_sheet; 105 enum DisabledState { 106 Unset, 107 EnabledViaScript, 108 Disabled 109 }; 110 103 111 KURL m_url; 104 112 String m_type; 105 113 String m_media; 106 114 RefPtr<DOMSettableTokenList> m_sizes; 115 DisabledState m_disabledState; 107 116 LinkRelAttribute m_relAttribute; 108 117 bool m_loading; 109 bool m_isEnabledViaScript;110 118 bool m_createdByParser; 111 119 bool m_isInShadowTree; -
trunk/Source/WebCore/html/HTMLLinkElement.idl
r91893 r94369 23 23 24 24 interface HTMLLinkElement : HTMLElement { 25 attribute boolean disabled;25 attribute [Reflect] boolean disabled; 26 26 attribute [Reflect] DOMString charset; 27 27 attribute [Reflect, URL] DOMString href;
Note: See TracChangeset
for help on using the changeset viewer.