OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 }; | 350 }; |
351 | 351 |
352 // static | 352 // static |
353 CSSStyleRule* InspectorCSSAgent::asCSSStyleRule(CSSRule* rule) | 353 CSSStyleRule* InspectorCSSAgent::asCSSStyleRule(CSSRule* rule) |
354 { | 354 { |
355 if (!rule || rule->type() != CSSRule::STYLE_RULE) | 355 if (!rule || rule->type() != CSSRule::STYLE_RULE) |
356 return 0; | 356 return 0; |
357 return toCSSStyleRule(rule); | 357 return toCSSStyleRule(rule); |
358 } | 358 } |
359 | 359 |
360 template <typename CharType, size_t bufferLength> | |
361 static size_t vendorPrefixLowerCase(const CharType* string, size_t stringLength,
char (&buffer)[bufferLength]) | |
362 { | |
363 static const char lowerCaseOffset = 'a' - 'A'; | |
364 | |
365 if (string[0] != '-') | |
366 return 0; | |
367 | |
368 for (size_t i = 0; i < stringLength - 1; i++) { | |
369 CharType c = string[i + 1]; | |
370 if (c == '-') | |
371 return i; | |
372 if (i == bufferLength) | |
373 break; | |
374 if (c < 'A' || c > 'z') | |
375 break; | |
376 if (c >= 'a') | |
377 buffer[i] = c; | |
378 else if (c <= 'Z') | |
379 buffer[i] = c + lowerCaseOffset; | |
380 else | |
381 break; | |
382 } | |
383 return 0; | |
384 } | |
385 | |
386 InspectorCSSAgent::InspectorCSSAgent(InspectorDOMAgent* domAgent, InspectorPageA
gent* pageAgent, InspectorResourceAgent* resourceAgent) | 360 InspectorCSSAgent::InspectorCSSAgent(InspectorDOMAgent* domAgent, InspectorPageA
gent* pageAgent, InspectorResourceAgent* resourceAgent) |
387 : InspectorBaseAgent<InspectorCSSAgent>("CSS") | 361 : InspectorBaseAgent<InspectorCSSAgent>("CSS") |
388 , m_frontend(0) | 362 , m_frontend(0) |
389 , m_domAgent(domAgent) | 363 , m_domAgent(domAgent) |
390 , m_pageAgent(pageAgent) | 364 , m_pageAgent(pageAgent) |
391 , m_resourceAgent(resourceAgent) | 365 , m_resourceAgent(resourceAgent) |
392 , m_lastStyleSheetId(1) | 366 , m_lastStyleSheetId(1) |
393 , m_styleSheetsPendingMutation(0) | 367 , m_styleSheetsPendingMutation(0) |
394 , m_styleDeclarationPendingMutation(false) | 368 , m_styleDeclarationPendingMutation(false) |
395 , m_creatingViaInspectorStyleSheet(false) | 369 , m_creatingViaInspectorStyleSheet(false) |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 documentsToChange.add(element->ownerDocument()); | 1426 documentsToChange.add(element->ownerDocument()); |
1453 } | 1427 } |
1454 | 1428 |
1455 m_nodeIdToForcedPseudoState.clear(); | 1429 m_nodeIdToForcedPseudoState.clear(); |
1456 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu
mentsToChange.end(); it != end; ++it) | 1430 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu
mentsToChange.end(); it != end; ++it) |
1457 (*it)->setNeedsStyleRecalc(SubtreeStyleChange); | 1431 (*it)->setNeedsStyleRecalc(SubtreeStyleChange); |
1458 } | 1432 } |
1459 | 1433 |
1460 } // namespace WebCore | 1434 } // namespace WebCore |
1461 | 1435 |
OLD | NEW |