| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) | 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) |
| 3 * Copyright (C) 2006 Jon Shier (jshier@iastate.edu) | 3 * Copyright (C) 2006 Jon Shier (jshier@iastate.edu) |
| 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights resev
ed. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights resev
ed. |
| 5 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 namespace WebCore { | 31 namespace WebCore { |
| 32 | 32 |
| 33 // Though isspace() considers \t and \v to be whitespace, Win IE doesn't when pa
rsing window features. | 33 // Though isspace() considers \t and \v to be whitespace, Win IE doesn't when pa
rsing window features. |
| 34 static bool isWindowFeaturesSeparator(UChar c) | 34 static bool isWindowFeaturesSeparator(UChar c) |
| 35 { | 35 { |
| 36 return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '=' || c == '
,' || c == '\0'; | 36 return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '=' || c == '
,' || c == '\0'; |
| 37 } | 37 } |
| 38 | 38 |
| 39 WindowFeatures::WindowFeatures(const String& features) | 39 WindowFeatures::WindowFeatures(const String& features) |
| 40 : xSet(false) | 40 : x(0) |
| 41 , xSet(false) |
| 42 , y(0) |
| 41 , ySet(false) | 43 , ySet(false) |
| 44 , width(0) |
| 42 , widthSet(false) | 45 , widthSet(false) |
| 46 , height(0) |
| 43 , heightSet(false) | 47 , heightSet(false) |
| 48 , resizable(true) |
| 44 , fullscreen(false) | 49 , fullscreen(false) |
| 45 , dialog(false) | 50 , dialog(false) |
| 46 { | 51 { |
| 47 /* | 52 /* |
| 48 The IE rule is: all features except for channelmode and fullscreen default
to YES, but | 53 The IE rule is: all features except for channelmode and fullscreen default
to YES, but |
| 49 if the user specifies a feature string, all features default to NO. (There
is no public | 54 if the user specifies a feature string, all features default to NO. (There
is no public |
| 50 standard that applies to this method.) | 55 standard that applies to this method.) |
| 51 | 56 |
| 52 <http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.a
sp> | 57 <http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.a
sp> |
| 53 We always allow a window to be resized, which is consistent with Firefox. | 58 We always allow a window to be resized, which is consistent with Firefox. |
| 54 */ | 59 */ |
| 55 | 60 |
| 56 if (features.length() == 0) { | 61 if (features.isEmpty()) { |
| 57 menuBarVisible = true; | 62 menuBarVisible = true; |
| 58 statusBarVisible = true; | 63 statusBarVisible = true; |
| 59 toolBarVisible = true; | 64 toolBarVisible = true; |
| 60 locationBarVisible = true; | 65 locationBarVisible = true; |
| 61 scrollbarsVisible = true; | 66 scrollbarsVisible = true; |
| 62 resizable = true; | |
| 63 return; | 67 return; |
| 64 } | 68 } |
| 65 | 69 |
| 66 menuBarVisible = false; | 70 menuBarVisible = false; |
| 67 statusBarVisible = false; | 71 statusBarVisible = false; |
| 68 toolBarVisible = false; | 72 toolBarVisible = false; |
| 69 locationBarVisible = false; | 73 locationBarVisible = false; |
| 70 scrollbarsVisible = false; | 74 scrollbarsVisible = false; |
| 71 resizable = true; | |
| 72 | 75 |
| 73 // Tread lightly in this code -- it was specifically designed to mimic Win I
E's parsing behavior. | 76 // Tread lightly in this code -- it was specifically designed to mimic Win I
E's parsing behavior. |
| 74 int keyBegin, keyEnd; | 77 int keyBegin, keyEnd; |
| 75 int valueBegin, valueEnd; | 78 int valueBegin, valueEnd; |
| 76 | 79 |
| 77 int i = 0; | 80 int i = 0; |
| 78 int length = features.length(); | 81 int length = features.length(); |
| 79 String buffer = features.lower(); | 82 String buffer = features.lower(); |
| 80 while (i < length) { | 83 while (i < length) { |
| 81 // skip to first non-separator, but don't skip past the end of the strin
g | 84 // skip to first non-separator, but don't skip past the end of the strin
g |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 if (separatorPosition != kNotFound) { | 259 if (separatorPosition != kNotFound) { |
| 257 value = featureString.substring(separatorPosition + 1).stripWhiteSpa
ce().lower(); | 260 value = featureString.substring(separatorPosition + 1).stripWhiteSpa
ce().lower(); |
| 258 value = value.left(value.find(' ')); | 261 value = value.left(value.find(' ')); |
| 259 } | 262 } |
| 260 | 263 |
| 261 map.set(key, value); | 264 map.set(key, value); |
| 262 } | 265 } |
| 263 } | 266 } |
| 264 | 267 |
| 265 } // namespace WebCore | 268 } // namespace WebCore |
| OLD | NEW |