Start a block inside the media

@param selectors
the selectors
@param output
a buffer for the content of the rule.
963130
void startBlock( String[] selectors , StringBuilder output  ) {
        this.results.add( new CssRuleOutput( selectors, output, isReference ) );
    }
66628
function (env) {
        var css = [],      // The CSS output
            rules = [],    // node.Rule instances
           _rules = [],    //
            rulesets = [], // node.Ruleset instances
            selector,      // The fully rendered selector
            debugInfo,     // Line number debugging
            rule;

        // Compile rules and rulesets
        for (var i = 0; i < this.rules.length; i++) {
            rule = this.rules[i];

            if (rule.rules || (rule instanceof tree.Media)) {
                rulesets.push(rule.toCSS(env));
            } else if (rule instanceof tree.Directive) {
                var cssValue = rule.toCSS(env);
                // Output only the first @charset definition as such - convert the others
                // to comments in case debug is enabled
                if (rule.name === "@charset") {
                    // Only output the debug info together with subsequent @charset definitions
                    // a comment (or @media statement) before the actual @charset directive would
                    // be considered illegal css as it has to be on the first line
                    if (env.charset) {
                        if (rule.debugInfo) {
                            rulesets.push(tree.debugInfo(env, rule));
                            rulesets.push(new tree.Comment("/* "+cssValue.replace(/\n/g, "")+" */\n").toCSS(env));
                        }
                        continue;
                    }
                    env.charset = true;
                }
                rulesets.push(cssValue);
            } else if (rule instanceof tree.Comment) {
                if (!rule.silent) {
                    if (this.root) {
                        rulesets.push(rule.toCSS(env));
                    } else {
                        rules.push(rule.toCSS(env));
                    }
                }
            } else {
                if (rule.toCSS && !rule.variable) {
                    if (this.firstRoot && rule instanceof tree.Rule) {
                        throw { message: "properties must be inside selector blocks, they cannot be in the root.",
                            index: rule.index, filename: rule.currentFileInfo ? rule.currentFileInfo.filename : null};
                    }
                    rules.push(rule.toCSS(env));
                } else if (rule.value && !rule.variable) {
                    rules.push(rule.value.toString());
                }
            }
        } 

        // Remove last semicolon
        if (env.compress && rules.length) {
            rule = rules[rules.length - 1];
            if (rule.charAt(rule.length - 1) === ';') {
                rules[rules.length - 1] = rule.substring(0, rule.length - 1);
            }
        }

        rulesets = rulesets.join('');

        // If this is the root node, we don't render
        // a selector, or {}.
        // Otherwise, only output if this ruleset has rules.
        if (this.root) {
            css.push(rules.join(env.compress ? '' : '\n'));
        } else {
            if (rules.length > 0) {
                debugInfo = tree.debugInfo(env, this);
                selector = this.paths.map(function (p) {
                    return p.map(function (s) {
                        return s.toCSS(env);
                    }).join('').trim();
                }).join(env.compress ? ',' : ',\n');

                // Remove duplicates
                for (var i = rules.length - 1; i >= 0; i--) {
                    if (rules[i].slice(0, 2) === "/*" ||  _rules.indexOf(rules[i]) === -1) {
                        _rules.unshift(rules[i]);
                    }
                }
                rules = _rules;

                css.push(debugInfo + selector + 
                        (env.compress ? '{' : ' {\n  ') +
                        rules.join(env.compress ? '' : '\n  ') +
                        (env.compress ? '}' : '\n}\n'));
            }
        }
        css.push(rulesets);

        return css.join('')  + (env.compress ? '\n' : '');
    }
594119
private void setBlocking(boolean blocking) {

        if (blocking) {
            getElement().addClassName(I_CmsLayoutBundle.INSTANCE.notificationCss().blocking());
        } else {
            getElement().removeClassName(I_CmsLayoutBundle.INSTANCE.notificationCss().blocking());
        }
    }
1095062
void start(final Handler<OutputGroup> startHandler) {
    connection.doGroupStart(id, name, args, parent);
    this.startHandler = startHandler;
  }
260688
public void printSolverState(final PrintStream output) {
        output.println("level=" + this.level);
        output.println("next=" + this.next);
        output.println("ignore=" + this.ignore);
        output.println("empty=" + this.empty);
        output.println("vars=" + this.vars);
        output.println("vals=" + this.vals);
        output.println("phases=" + this.phases);
        output.println("decisions=" + this.decisions);
        output.println("control=" + this.control);
        output.println("watches=" + this.watches);
        output.println("trail=" + this.trail);
        output.println("frames=" + this.frames);
    }
956327
final public void startContent(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int contentColumns, int preferredWidth) throws IOException, SQLException {
		startContent(out, req, resp, new int[] {contentColumns}, preferredWidth);
	}
583044
protected function startRenderBlock($blockName, $segmentText)
    {
        foreach ($this->plugins as $plugin) {
            $blockRenderList = $plugin->getBlockRenderList();
            if (in_array($blockName, $blockRenderList) === true) {
                echo $plugin->callBlockRenderStart($blockName, $segmentText);
                ob_start();
                return;
            }
        }
        throw new JigException("Block $blockName not known for starting block in plugins.");
    }
265792
@Override
    public void startedPart(Map headers) {
        if (_docReader != null)
            throw new IllegalStateException("_docReader is already defined");
        Log.v(TAG, "%s: Starting new document; headers =%s", this, headers);
        _docReader = new MultipartDocumentReader(db);
        _docReader.setHeaders(headers);
        _docReader.startedPart(headers);
    }
3713
protected void applyThreshold( T input, GrayU8 output ) {
		for (int blockY = 0; blockY < stats.height; blockY++) {
			for (int blockX = 0; blockX < stats.width; blockX++) {
				original.thresholdBlock(blockX,blockY,input,stats,output);
			}
		}
	}
930531
function(input, startIndex) {
		var begin;
		var end = startIndex;

		//First find the curly bracket that opens this block.
		while(end-- && input.charAt(end) !== '{') {}

		//The end is now fixed to the right of the selector.
		//Now start there to find the begin of the selector.
		begin = end;

		//Now walk farther backwards until we grabbed the whole selector.
		//This either ends at beginning of string or at end of next block.
		while(begin-- && input.charAt(begin - 1) !== '}') {}

		//Return the cleaned selector.
		return input.substring(begin, end).replace(/[\n\r\t]/g, '');
	}
131229
@Override
	public void block(MatchData data) {
		numCorrectPairs = countCorrectPairs(data);
		pairList = new ArrayList<Blocker.Pair>();
		if (clusterMode)
			throw new IllegalArgumentException("clusterMode=true is not valid for this blocker");
		
		String sfSource = data.getSource(0);
		String lfSource = data.getSource(1);
		if(!sfSource.equals("short")){
			String tmp = sfSource;
			sfSource = lfSource;
			lfSource = tmp;
		}
		
		// index the smaller source
		double maxSetSize = data.numInstances(sfSource)*maxFraction;
		Map<Token, Set<Integer>> index = new TreeMap<Token, Set<Integer>>();
		for (int i=0; i<data.numInstances(sfSource); i++) {
			Token[] tokens = tokenizer.tokenize( data.getInstance(sfSource,i).unwrap() );
			for (int j=0; j<tokens.length; j++) {
				Set<Integer> containers = index.get(tokens[j]);
				if (containers==STOPWORD_TOKEN_MARKER) {
					/* do nothing */;
				} else if (containers==null) {
					containers = new TreeSet<Integer>();
					index.put(tokens[j], containers);
				} 
				containers.add( new Integer(i) );
				// mark this if it's too full
				if (containers.size() > maxSetSize) {  
					index.put(tokens[j], STOPWORD_TOKEN_MARKER);						
				} 
			}
		}
		//System.out.println("data:\n"+data); showIndex(index);
		// find pairs
		Set<Integer> pairedUpInstances = new TreeSet<Integer>();
		for (int i=0; i<data.numInstances(lfSource); i++) {
			MatchData.Instance lfInst = data.getInstance(lfSource,i);
			pairedUpInstances.clear();
			Token[] tokens = tokenizer.tokenize( lfInst.unwrap() );			
			for (int j=0; j<tokens.length; j++) {			
				Set<Integer> containers = index.get( tokens[j] );
				if (containers!=null && containers!=STOPWORD_TOKEN_MARKER) {
					for (Iterator<Integer> k=containers.iterator(); k.hasNext(); ) {
						Integer smallIndexInteger = (Integer)k.next();
						int smallIndex = smallIndexInteger.intValue();
						if (!pairedUpInstances.contains(smallIndexInteger) && 
								(sfSource!=lfSource || smallIndex>i))
						{
							MatchData.Instance sfInst = data.getInstance(sfSource, smallIndex);
							// Matching of short-form --> long-form is directional. 
							pairList.add( new Blocker.Pair( sfInst, lfInst, sfInst.sameId(lfInst) ));
							pairedUpInstances.add( smallIndexInteger );
						}
					}
				}
			}
		}
	}
1014819
public void startElement(
          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
            throws SAXException
  {
    //System.out.println("ProcessorFunction.startElement()");
    String msg = "";
    if (!(handler.getElemTemplateElement() instanceof Stylesheet))
    {
      msg = "func:function element must be top level.";
      handler.error(msg, new SAXException(msg));
    }
    super.startElement(handler, uri, localName, rawName, attributes);
       
    String val = attributes.getValue("name");
    int indexOfColon = val.indexOf(":");
    if (indexOfColon > 0)
    {
      //String prefix = val.substring(0, indexOfColon);
      //String localVal = val.substring(indexOfColon + 1);
      //String ns = handler.getNamespaceSupport().getURI(prefix);
      //if (ns.length() > 0)
      //  System.out.println("fullfuncname " + ns + localVal);
    }
    else
    {
      msg = "func:function name must have namespace";
      handler.error(msg, new SAXException(msg));
    }
  }
408092
protected function makeOutputBlock($type, $selectors = null)
    {
        $out = new OutputBlock;
        $out->type         = $type;
        $out->lines        = [];
        $out->children     = [];
        $out->parent       = $this->scope;
        $out->selectors    = $selectors;
        $out->depth        = $this->env->depth;
        $out->sourceName   = $this->env->block->sourceName;
        $out->sourceLine   = $this->env->block->sourceLine;
        $out->sourceColumn = $this->env->block->sourceColumn;

        return $out;
    }
450513
void parseBlock( FormattableContainer currentRule ) {
        Operation expr = null;
        String name = null;
        Expression guard = null;
        StringBuilder builder = cachesBuilder;
        boolean wasWhite = false;
        for( ;; ) {
            char ch = reader.read();
            switch( ch ) {
                case '{':
                    String selector;
                    if( name == null ) {
                        selector = trim( builder );
                    } else {
                        selector = name;
                        name = null;
                        throwUnrecognizedInputIfAny( builder, ch );
                    }
                    if( selector.endsWith( "@" ) ) { // selector with variable name like abc@{foo}abc
                        builder.append( selector );
                        builder.append( ch );
                        break;
                    }
                    if( selector.contains( ":extend(" ) ) {
                        selector = LessExtend.addLessExtendsTo( currentRule, reader, selector );
                    }
                    Rule rule = rule( currentRule, selector, expr, guard );
                    currentRule.add( rule );
                    expr = null;
                    guard = null;
                    String[] selectors = rule.getSelectors();
                    for( String sel : selectors ) {
                        currentRule.getMixins().add( sel.trim(), rule );
                    }
                    return;
                case '/':
                    if( !comment( isWhitespace( builder ) ? currentRule : null ) ) {
                        builder.append( ch );
                    }
                    wasWhite = false;
                    break;
                case '\"':
                case '\'':
                    readQuote( ch, builder );
                    wasWhite = false;
                    break;
                case '(':
                    String cmd;
                    if( name == null ) {
                        int idx = builder.lastIndexOf( " when" );
                        if( idx < 0 || (idx + 5 != builder.length() && builder.indexOf( " when " ) < 0) ) {
                            if( isSelector( builder ) || !reader.nextIsMixinParam( true ) ) {
                                builder.append( ch );
                                break;
                            }
                        }
                        name = trim( builder );
                        if( idx < 0 ) {
                            expr = parseParameterList();
                            break;
                        } else {
                            cmd = name.substring( idx + 1 );
                            name = name.substring( 0, idx );
                        }
                    } else {
                        cmd = trim( builder );
                    }
                    char operator;
                    boolean isNot = false;
                    switch( cmd ) {
                        case "when not":
                            isNot = true;
                            //$FALL-THROUGH$
                        case "when":
                            operator = 0;
                            break;
                        case "and not":
                            isNot = true;
                            //$FALL-THROUGH$
                        case "and":
                            operator = '&';
                            break;
                        case ",not":
                        case ", not":
                            isNot = true;
                            //$FALL-THROUGH$
                        case ",":
                            operator = '|';
                            break;
                        default:
                            throw createException( "Unrecognized input: '" + cmd + "'" );
                    }
                    Expression right = parseExpression( (char)0 );
                    ch = read();
                    if( ch != ')' ) {
                        throw createException( "Unrecognized input: '" + ch + "'" );
                    }
                    if( isNot ) {
                        right = new Operation( reader, right, '!' );
                    }
                    guard = ( operator == 0 ) ? right : concat( guard, operator, right );
                    break;
                default:
                    boolean isWhite = Character.isWhitespace( ch );
                    if( isWhite ) {
                        if( builder.length() == 0 ) {
                            break;
                        }
                        if( wasWhite ) {
                            break;
                        } else {
                            builder.append( ' ' );
                            wasWhite = true;
                        }
                    } else {
                        builder.append( ch );
                        wasWhite = false;
                    }
            }
        }
    }
907752
public function firstOrFail($selectors)
    {
        foreach ((array) $selectors as $selector) {
            try {
                return $this->findOrFail($selector);
            } catch (Exception $e) {
                //
            }
        }

        throw $e;
    }
785486
protected function flattenSelectors(OutputBlock $block, $parentKey = null)
    {
        if ($block->selectors) {
            $selectors = [];

            foreach ($block->selectors as $s) {
                $selectors[] = $s;

                if (! is_array($s)) {
                    continue;
                }

                // check extends
                if (! empty($this->extendsMap)) {
                    $this->matchExtends($s, $selectors);

                    // remove duplicates
                    array_walk($selectors, function (&$value) {
                        $value = serialize($value);
                    });

                    $selectors = array_unique($selectors);

                    array_walk($selectors, function (&$value) {
                        $value = unserialize($value);
                    });
                }
            }

            $block->selectors = [];
            $placeholderSelector = false;

            foreach ($selectors as $selector) {
                if ($this->hasSelectorPlaceholder($selector)) {
                    $placeholderSelector = true;
                    continue;
                }

                $block->selectors[] = $this->compileSelector($selector);
            }

            if ($placeholderSelector && 0 === count($block->selectors) && null !== $parentKey) {
                unset($block->parent->children[$parentKey]);

                return;
            }
        }

        foreach ($block->children as $key => $child) {
            $this->flattenSelectors($child, $key);
        }
    }
295010
@Override
    public void start(boolean block) throws InterruptedException, ExecutionException {
        Future<?> task = m_es.submit(new ParentEvent(null));
        if (block) {
            task.get();
        }
    }